package main import "testing" func TestFlood(t *testing.T) { testCases := []struct { Input string Result bool }{ { Input: `! ! ! ! ! ! ! !`, Result: true, }, { Input: `test test test test abc abc`, Result: true, }, { Input: `! test ! test ! test ! test !`, Result: true, }, { Input: `a b c d e f g h i j`, Result: false, }, { Input: `const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };`, Result: false, }, { Input: `a = b > 3 ? 2 : 4`, Result: false, }, { Input: `AAAAAAAAAAAAAAAAAAAA`, Result: true, }, { Input: `AAAAAAAAAABBBBBBBBBB`, Result: true, }, { Input: `ivy 3 3 rho (iota 9) in 2 6 7 8 9`, Result: false, }, } for _, tc := range testCases { t.Run(tc.Input, func(t *testing.T) { if isFlood(tc.Input) != tc.Result { t.Errorf("want %v", tc.Result) } }) } }