Last active
October 19, 2020 21:52
-
-
Save invisiblefunnel/82fa6300282f5495c2ba5bda27bc9377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"testing" | |
"testing/quick" | |
flatbuffers "github.com/google/flatbuffers/go" | |
) | |
// TestCreateSharedStringReset ... | |
func TestCreateSharedStringReset(t *testing.T) { | |
f := func(a, b string) bool { | |
if a == b { | |
return true | |
} | |
builder := flatbuffers.NewBuilder(0) | |
a1 := builder.CreateSharedString(a) | |
b1 := builder.CreateSharedString(b) | |
builder.Reset() | |
b2 := builder.CreateSharedString(b) | |
a2 := builder.CreateSharedString(a) | |
return !(a1 == a2 || b1 == b2) | |
} | |
if err := quick.Check(f, nil); err != nil { | |
t.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment