diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-09-16 13:41:01 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-09-16 13:41:01 +0200 |
commit | 477d7014edc787ba9a977acd19fcbfc55531768b (patch) | |
tree | ac8b65be8634fa9526cd727da60893244d11e88a /goldap/write_test.go | |
parent | a53641e773730ba171df2602c8d199968d6e6447 (diff) | |
download | bottin-477d7014edc787ba9a977acd19fcbfc55531768b.tar.gz bottin-477d7014edc787ba9a977acd19fcbfc55531768b.zip |
Vendor goldap
Diffstat (limited to 'goldap/write_test.go')
-rw-r--r-- | goldap/write_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/goldap/write_test.go b/goldap/write_test.go new file mode 100644 index 0000000..7c82bd7 --- /dev/null +++ b/goldap/write_test.go @@ -0,0 +1,19 @@ +package message + +import ( + "reflect" + "testing" +) + +func TestWriteLDAPMessage(t *testing.T) { + + var testData = getLDAPMessageTestData() + for i, test := range testData { + bytes, err := test.out.Write() + if err != nil { + t.Errorf("#%d error at offset %d (%s): %s\nEXPECTED BYTES: %#v\nWRITTEN BYTES: %#v\n", i, test.bytes.offset, test.bytes.DumpCurrentBytes(), err, test.bytes.getBytes(), bytes.getBytes()) + } else if !reflect.DeepEqual(bytes.getBytes(), test.bytes.getBytes()) { + t.Errorf("#%d:\nGOT:\n%#+v\nEXPECTED:\n%#+v", i, bytes.getBytes(), test.bytes.getBytes()) + } + } +} |