packageflatfsimport("testing""github.com/ipfs/go-datastore")var(validKeys=[]string{"/FOO","/1BAR1","/=EMACS-IS-KING=",}invalidKeys=[]string{"/foo/bar",`/foo\bar`,"/foo\000bar","/=Vim-IS-KING=",})funcTestKeyIsValid(t*testing.T){for_,key:=rangevalidKeys{k:=datastore.NewKey(key)if!keyIsValid(k){t.Errorf("expected key %s to be valid",k)}}for_,key:=rangeinvalidKeys{k:=datastore.NewKey(key)ifkeyIsValid(k){t.Errorf("expected key %s to be invalid",k)}}}