summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/custom/99_bugs/42_types_binary_string_comparison28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/42_types_binary_string_comparison b/tests/custom/99_bugs/42_types_binary_string_comparison
new file mode 100644
index 0000000..bc566c6
--- /dev/null
+++ b/tests/custom/99_bugs/42_types_binary_string_comparison
@@ -0,0 +1,28 @@
+When comparing strings with embedded null bytes, ensure that the comparison
+takes the entire string length into account.
+
+-- Testcase --
+printf("%.J\n", [
+ "" == "\u0000",
+ "" < "\u0000",
+ "" > "\u0000",
+ "foo\u0000bar" == "foo\u0000baz",
+ "foo\u0000bar" < "foo\u0000baz",
+ "foo\u0000bar" > "foo\u0000baz",
+]);
+-- End --
+
+-- Args --
+-R
+-- End --
+
+-- Expect stdout --
+[
+ false,
+ true,
+ false,
+ false,
+ true,
+ false
+]
+-- End --