Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testReadingLine doesn't work #8

Open
danpalmer opened this issue Apr 2, 2014 · 1 comment
Open

testReadingLine doesn't work #8

danpalmer opened this issue Apr 2, 2014 · 1 comment

Comments

@danpalmer
Copy link

Either that, or I'm just getting it completely wrong.

I fill out the getChar koan, then the prompt asks me for "a", which I give it, but then it fails immediately even once I've filled out the getLine koan. I assume that once the first is passing, it should be prompting me to enter "burrito", but instead it just fails.

testReadingChar :: Spec
testReadingChar = it "getChar" $ do
  putStrLn "Write: \"a\" to pass this test: "
  -- NOTE: replace 'failIO' with the actual function
  result <- getChar
  assertEqual ""
              'a'
              result

testReadingLine :: Spec
testReadingLine = it "getLine" $ do
    -- NOTE: replace 'failIO' with the actual function
    result <- getLine
    assertEqual "Write: \"burrito\" to pass this test"
                "burrito"
                result

That's my solution, the output from the console is:

BasicIO
Write: "a" to pass this test: 
a
  - getChar
  - getLine FAILED [1]

1) BasicIO getLine
Write: "burrito" to pass this test
expected: "burrito"
 but got: ""
@p-alik
Copy link

p-alik commented Dec 8, 2014

put together
aburrito

nathandcornell pushed a commit to nathandcornell/HaskellKoans that referenced this issue Feb 27, 2016
nathandcornell pushed a commit to nathandcornell/HaskellKoans that referenced this issue Feb 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants