From a4b99fcfaea554f074719d659e05643a7ccf3324 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 24 Jan 2025 18:51:21 +1300 Subject: [PATCH] test: add test for round-trip of zero length byte slices --- examples/marshalling/marshalling_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/marshalling/marshalling_test.go b/examples/marshalling/marshalling_test.go index 15d5d8d0..115b1b4a 100644 --- a/examples/marshalling/marshalling_test.go +++ b/examples/marshalling/marshalling_test.go @@ -106,6 +106,17 @@ func testMarshalling(t *testing.T) { } }) + t.Run("QByteArray of zero length", func(t *testing.T) { + + input := "" + ba := qt.QFile_EncodeName(input) + got := qt.QFile_DecodeName(ba) + + if input != got { + t.Fatalf("QByteArray: expected %q, got %q", input, got) + } + }) + // QMap t.Run("QMap", func(t *testing.T) { input := make(map[string]qt.QVariant)