예제 #1
0
func TestCryDifferentLocations(t *testing.T) {
	require.True(t, CryHeard())
	require.True(t, CryHeard())
	require.True(t, CryHeard())
	require.True(t, CryHeard())
	require.True(t, CryHeard())
}
예제 #2
0
func TestCrySameLocation(t *testing.T) {
	require.True(t, cryHeard())
	require.True(t, cryHeard())
	require.False(t, cryHeard())
	require.True(t, cryHeard())
	require.False(t, cryHeard())
	require.False(t, cryHeard())
	require.False(t, cryHeard())
	require.True(t, cryHeard())
}
예제 #3
0
func TestIterator(t *testing.T) {
	const s = "AAAABBBCCDAABBB"
	si := StringIterator(s)
	for i := range s {
		require.True(t, si.Next())
		require.Equal(t, s[i], si.Value().(byte))
	}
	require.False(t, si.Next())
}