There's something I don't understand about the test suite for week 5, or perhaps it's something I don't understand with eclipse.
I stupidly did my encode by pasting my decode function and then editing it, so of course I ended up with a part that wasn't modified correctly. There's no way the function could possibly have terminated (for any input), which I found out after I added my own tests. But, it initially passed their tests, which includes this test:
assert(decode(frenchCode, encode(frenchCode)("ab".toList)) === "ab".toList)
And my worksheet hung if I just copied the "encode(frenchCode)("ab".toList)" part of it to the worksheet. How could the test suite have passed?
Also, I keep getting random eclipse errors that don't make sense, e.g., I got an error on this line of my worksheet:
import patmat.Huffman._
which said that Huffman wasn't part of patmat. Cutting the line, saving, then pasting the line back and saving again caused the error to go away.
It seems like, about 2% of the time, when I save, I get a spurious error that goes away if I do some arbitrary manipulation to the text and save again. Is scala for eclipse known to be buggy? I've never used eclipse before, so I'm not sure if this is something I should expect.