Skip to content

Instantly share code, notes, and snippets.

@invisiblefunnel
Last active October 19, 2020 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save invisiblefunnel/82fa6300282f5495c2ba5bda27bc9377 to your computer and use it in GitHub Desktop.
Save invisiblefunnel/82fa6300282f5495c2ba5bda27bc9377 to your computer and use it in GitHub Desktop.
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