input_test.go 348 B

12345678910111213141516171819
  1. package door
  2. import (
  3. "testing"
  4. )
  5. func TestDisplayInput(t *testing.T) {
  6. verify := map[int]string{1: " \x08",
  7. 2: " \x08\x08",
  8. 5: " \x08\x08\x08\x08\x08",
  9. }
  10. for count, expect := range verify {
  11. got := string(DisplayInput(count))
  12. if expect != got {
  13. t.Errorf("DisplayInput %d, expected %#v, got %#v", count, expect, got)
  14. }
  15. }
  16. }