Exemplo n.º 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())
}
Exemplo n.º 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())
}
Exemplo n.º 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())
}