github.com/couchbaselabs/nex@v0.0.0-20230419191105-421cb5932838/nex_test.go (about) 1 package main 2 3 import ( 4 "bytes" 5 "crypto/md5" 6 "fmt" 7 "testing" 8 ) 9 10 var testinput = ` 11 /a|A/ { return A } 12 // 13 package main 14 ` 15 16 func TestGenStable(t *testing.T) { 17 for i := 0; i < 100; i++ { 18 var out bytes.Buffer 19 20 process(&out, bytes.NewBufferString(testinput)) 21 e := "13f760d2f0dc1743dd7165781f2a318d" 22 if x := fmt.Sprintf("%x", md5.Sum(out.Bytes())); x != e { 23 t.Errorf("got: %s wanted: %s", x, e) 24 } 25 } 26 }