예제 #1
0
func TestSimpleValues(t *testing.T) {
	r := ohyeah.RandomFunc(99)
	f := SimpleGen(r)

	for i := 0; i < 50; i++ {
		value := f()
		VerifyRoundTrip(t, value)
	}
}
예제 #2
0
func TestLists(t *testing.T) {
	r := ohyeah.RandomFunc(99)

	sg := SimpleGen(r)

	g := ListGen(r, sg, 10)

	for i := 0; i < 40; i++ {
		value := g()
		VerifyRoundTrip(t, value)
	}
}
예제 #3
0
func TestGeneratedMaps(t *testing.T) {
	r := ohyeah.RandomFunc(99)
	vg := SimpleGen(r)

	g := ohyeah.MapGen(r, KeywordGen(ohyeah.PatternedStringGen("key")), ohyeah.ArrayGen(r, vg, 10), 2000)

	for i := 0; i < 4; i++ {
		value := g()
		VerifyRoundTrip(t, value)
	}

}
예제 #4
0
func TestSets(t *testing.T) {
	r := ohyeah.RandomFunc(99)

	symg := SymbolGen(ohyeah.PatternedStringGen("key"))

	sg := ohyeah.RepeatGen(SetGen(r, symg, 2000), 1)
	g := ohyeah.ArrayGen(r, sg, 100)

	for i := 0; i < 40; i++ {
		value := g()
		VerifyRoundTrip(t, value)
	}
}