From 0c5d4944d3de3abf045348b2d831946bc9bfcf39 Mon Sep 17 00:00:00 2001 From: Riley Date: Fri, 11 Oct 2024 16:20:48 -0400 Subject: [PATCH 1/4] Tests for Base.cwstring --- contrib/asan/build.sh | 0 contrib/asan/check.jl | 0 contrib/bpftrace/gc_all.bt | 0 contrib/bpftrace/gc_simple.bt | 0 contrib/bpftrace/gc_stop_the_world_latency.bt | 0 contrib/bpftrace/rt_all.bt | 0 contrib/check-whitespace.jl | 0 contrib/commit-name.sh | 0 contrib/delete-all-rpaths.sh | 0 contrib/download_cmake.sh | 0 contrib/excise_stdlib.sh | 0 contrib/fixup-libgfortran.sh | 0 contrib/fixup-libstdc++.sh | 0 contrib/fixup-rpath.sh | 0 contrib/install.sh | 0 contrib/julia-config.jl | 0 contrib/mac/app/notarize_check.sh | 0 contrib/mac/app/renotarize_dmg.sh | 0 contrib/new-stdlib.sh | 0 contrib/normalize_triplet.py | 0 contrib/prepare_release.sh | 0 contrib/relative_path.py | 0 contrib/tsan/build.sh | 0 contrib/windows/icon-readme.md | 0 contrib/windows/julia-banner.bmp | Bin contrib/windows/julia.ico | Bin deps/tools/jlchecksum | 0 deps/tools/jldownload | 0 src/flisp/bootstrap.sh | 0 test/strings/basic.jl | 15 +++++++++++++++ 30 files changed, 15 insertions(+) mode change 100755 => 100644 contrib/asan/build.sh mode change 100755 => 100644 contrib/asan/check.jl mode change 100755 => 100644 contrib/bpftrace/gc_all.bt mode change 100755 => 100644 contrib/bpftrace/gc_simple.bt mode change 100755 => 100644 contrib/bpftrace/gc_stop_the_world_latency.bt mode change 100755 => 100644 contrib/bpftrace/rt_all.bt mode change 100755 => 100644 contrib/check-whitespace.jl mode change 100755 => 100644 contrib/commit-name.sh mode change 100755 => 100644 contrib/delete-all-rpaths.sh mode change 100755 => 100644 contrib/download_cmake.sh mode change 100755 => 100644 contrib/excise_stdlib.sh mode change 100755 => 100644 contrib/fixup-libgfortran.sh mode change 100755 => 100644 contrib/fixup-libstdc++.sh mode change 100755 => 100644 contrib/fixup-rpath.sh mode change 100755 => 100644 contrib/install.sh mode change 100755 => 100644 contrib/julia-config.jl mode change 100755 => 100644 contrib/mac/app/notarize_check.sh mode change 100755 => 100644 contrib/mac/app/renotarize_dmg.sh mode change 100755 => 100644 contrib/new-stdlib.sh mode change 100755 => 100644 contrib/normalize_triplet.py mode change 100755 => 100644 contrib/prepare_release.sh mode change 100755 => 100644 contrib/relative_path.py mode change 100755 => 100644 contrib/tsan/build.sh mode change 100755 => 100644 contrib/windows/icon-readme.md mode change 100755 => 100644 contrib/windows/julia-banner.bmp mode change 100755 => 100644 contrib/windows/julia.ico mode change 100755 => 100644 deps/tools/jlchecksum mode change 100755 => 100644 deps/tools/jldownload mode change 100755 => 100644 src/flisp/bootstrap.sh diff --git a/contrib/asan/build.sh b/contrib/asan/build.sh old mode 100755 new mode 100644 diff --git a/contrib/asan/check.jl b/contrib/asan/check.jl old mode 100755 new mode 100644 diff --git a/contrib/bpftrace/gc_all.bt b/contrib/bpftrace/gc_all.bt old mode 100755 new mode 100644 diff --git a/contrib/bpftrace/gc_simple.bt b/contrib/bpftrace/gc_simple.bt old mode 100755 new mode 100644 diff --git a/contrib/bpftrace/gc_stop_the_world_latency.bt b/contrib/bpftrace/gc_stop_the_world_latency.bt old mode 100755 new mode 100644 diff --git a/contrib/bpftrace/rt_all.bt b/contrib/bpftrace/rt_all.bt old mode 100755 new mode 100644 diff --git a/contrib/check-whitespace.jl b/contrib/check-whitespace.jl old mode 100755 new mode 100644 diff --git a/contrib/commit-name.sh b/contrib/commit-name.sh old mode 100755 new mode 100644 diff --git a/contrib/delete-all-rpaths.sh b/contrib/delete-all-rpaths.sh old mode 100755 new mode 100644 diff --git a/contrib/download_cmake.sh b/contrib/download_cmake.sh old mode 100755 new mode 100644 diff --git a/contrib/excise_stdlib.sh b/contrib/excise_stdlib.sh old mode 100755 new mode 100644 diff --git a/contrib/fixup-libgfortran.sh b/contrib/fixup-libgfortran.sh old mode 100755 new mode 100644 diff --git a/contrib/fixup-libstdc++.sh b/contrib/fixup-libstdc++.sh old mode 100755 new mode 100644 diff --git a/contrib/fixup-rpath.sh b/contrib/fixup-rpath.sh old mode 100755 new mode 100644 diff --git a/contrib/install.sh b/contrib/install.sh old mode 100755 new mode 100644 diff --git a/contrib/julia-config.jl b/contrib/julia-config.jl old mode 100755 new mode 100644 diff --git a/contrib/mac/app/notarize_check.sh b/contrib/mac/app/notarize_check.sh old mode 100755 new mode 100644 diff --git a/contrib/mac/app/renotarize_dmg.sh b/contrib/mac/app/renotarize_dmg.sh old mode 100755 new mode 100644 diff --git a/contrib/new-stdlib.sh b/contrib/new-stdlib.sh old mode 100755 new mode 100644 diff --git a/contrib/normalize_triplet.py b/contrib/normalize_triplet.py old mode 100755 new mode 100644 diff --git a/contrib/prepare_release.sh b/contrib/prepare_release.sh old mode 100755 new mode 100644 diff --git a/contrib/relative_path.py b/contrib/relative_path.py old mode 100755 new mode 100644 diff --git a/contrib/tsan/build.sh b/contrib/tsan/build.sh old mode 100755 new mode 100644 diff --git a/contrib/windows/icon-readme.md b/contrib/windows/icon-readme.md old mode 100755 new mode 100644 diff --git a/contrib/windows/julia-banner.bmp b/contrib/windows/julia-banner.bmp old mode 100755 new mode 100644 diff --git a/contrib/windows/julia.ico b/contrib/windows/julia.ico old mode 100755 new mode 100644 diff --git a/deps/tools/jlchecksum b/deps/tools/jlchecksum old mode 100755 new mode 100644 diff --git a/deps/tools/jldownload b/deps/tools/jldownload old mode 100755 new mode 100644 diff --git a/src/flisp/bootstrap.sh b/src/flisp/bootstrap.sh old mode 100755 new mode 100644 diff --git a/test/strings/basic.jl b/test/strings/basic.jl index 874607f3c1b20..1defde0c4ee50 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -1409,3 +1409,18 @@ end @test transcode(String, transcode(UInt8, transcode(UInt16, str))) == str end end + +@testset "cwstring" begin + # empty string + str_0 = "" + # string with embedded NUL character + str_1 = "Au\000B" + # string with terminating NUL character + str_2 = "Wordu\000" + # "Regular" string with UTF-8 characters of differing byte counts + str_3 = "aܣ𒀀" + @test Base.cwstring(str_0) = UInt16[0x0000] + @test_throws ArgumentError Base.cwstring(str_1) + @test Base.cwstring(str_2) == UInt16[0x0057, 0x006f, 0x0072, 0x0064, 0x0000] + @test Base.cwstring(str_3) == UInt16[0x0061, 0x0723, 0xd808, 0xdc00, 0x0000] +end \ No newline at end of file From 4bd0536473f5a9d89a7f81ba34e9df8f2a8c6a1c Mon Sep 17 00:00:00 2001 From: rileysheridan Date: Fri, 18 Oct 2024 16:52:24 -0400 Subject: [PATCH 2/4] Update test/strings/basic.jl Fixes equality operator in first test of "cwstring" testset Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com> --- test/strings/basic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/strings/basic.jl b/test/strings/basic.jl index 1defde0c4ee50..a7d421ab313e5 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -1419,7 +1419,7 @@ end str_2 = "Wordu\000" # "Regular" string with UTF-8 characters of differing byte counts str_3 = "aܣ𒀀" - @test Base.cwstring(str_0) = UInt16[0x0000] + @test Base.cwstring(str_0) == UInt16[0x0000] @test_throws ArgumentError Base.cwstring(str_1) @test Base.cwstring(str_2) == UInt16[0x0057, 0x006f, 0x0072, 0x0064, 0x0000] @test Base.cwstring(str_3) == UInt16[0x0061, 0x0723, 0xd808, 0xdc00, 0x0000] From e05fe646540b0b999fed39776e5f43d2259009d2 Mon Sep 17 00:00:00 2001 From: Riley Sheridan Date: Sat, 19 Oct 2024 01:33:59 -0400 Subject: [PATCH 3/4] Restored execute file permissions to check-whitespace.jl --- contrib/check-whitespace.jl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 contrib/check-whitespace.jl diff --git a/contrib/check-whitespace.jl b/contrib/check-whitespace.jl old mode 100644 new mode 100755 From 99ca9685f28fa093f60e2290668cdd3d10b29fdd Mon Sep 17 00:00:00 2001 From: Riley Sheridan Date: Sat, 19 Oct 2024 02:13:02 -0400 Subject: [PATCH 4/4] Added back trailing newline to basic.jl --- test/strings/basic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/strings/basic.jl b/test/strings/basic.jl index a7d421ab313e5..9c31c0540e9ca 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -1423,4 +1423,4 @@ end @test_throws ArgumentError Base.cwstring(str_1) @test Base.cwstring(str_2) == UInt16[0x0057, 0x006f, 0x0072, 0x0064, 0x0000] @test Base.cwstring(str_3) == UInt16[0x0061, 0x0723, 0xd808, 0xdc00, 0x0000] -end \ No newline at end of file +end