Defective Tests in protein-translation in Go track

When running the tests in the protein-translation exercise of the Go track, the exercise fails to build at all. The error is below.

# proteintranslation [proteintranslation.test]
./cases_test.go:182:18: undefined: ErrInvalidBase
./cases_test.go:188:18: undefined: ErrInvalidBase
./protein_translation_test.go:16:16: undefined: ErrStop
./protein_translation_test.go:20:16: undefined: ErrInvalidBase
./protein_translation_test.go:94:18: undefined: ErrStop
./protein_translation_test.go:99:18: undefined: ErrStop
./protein_translation_test.go:104:18: undefined: ErrStop
./protein_translation_test.go:109:18: undefined: ErrInvalidBase
FAIL    proteintranslation [build failed]
Exception: go exited with 1
  [tty 6]:1:1-7: go test

Given those are exported bindings, I’m fairly sure the expectation is that the student defines them. Perhaps that can be made clearer with a comment in the starting sub.

1 Like

Ah, I see. The student stub doesn’t mention errors at all, so an updated version would certainly be helpful.

Update: I defined ErrInvalidBase and the linter said that ErrInvalidBase is not an expression. I went and looked where that error was (cases_test.go), and ErrInvalidBase was only used as an expression with a variable being assigned that value. From the structure of that file, I’m guessing that the undefined variables are meant to store a more complicated expression that gets compared to the output of the student’s program.

You’re expected to define variables with those names and type error.

Ah, I see. Thank you for pushing me in the right direction.