diff --git a/hogwarts/courselist_test.go b/hogwarts/courselist_test.go index 2cecbf4..aab0205 100644 --- a/hogwarts/courselist_test.go +++ b/hogwarts/courselist_test.go @@ -14,6 +14,9 @@ func impl(t *testing.T, prereqs map[string][]string, courseList []string) { t.Errorf("course %v (index %v) depends on course %v which is not taken yet", course, index, prereq) } } + if learned[course] { + t.Errorf("course %v (index %v) has been taken at least twice", course, index) + } learned[course] = true } for course := range prereqs {