this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

test: document non-ASCII punctuation behavior as known limitation

authored by

Mike Bannister and committed by
Tim Culverhouse
c328ee6d c4eeee81

+25
+12
src/vxfw/TextField.zig
··· 738 738 try std.testing.expectEqualStrings("-latte", input.buf.secondHalf()); 739 739 } 740 740 741 + test "non-ASCII punctuation treated as word chars" { 742 + var input = TextField.init(std.testing.allocator); 743 + defer input.deinit(); 744 + // Em dash (U+2014, 3 bytes: E2 80 94) has bytes >= 0x80, so all bytes are 745 + // classified as word chars. The entire string is one continuous "word" — the 746 + // em dash does NOT act as a separator. This is a known limitation of the 747 + // byte-based classifier. 748 + try input.insertSliceAtCursor("hello\xe2\x80\x94world"); 749 + input.moveBackwardWordwise(); 750 + try std.testing.expectEqualStrings("", input.buf.firstHalf()); 751 + } 752 + 741 753 test "deleteWordBefore with non-ASCII text" { 742 754 var input = TextField.init(std.testing.allocator); 743 755 defer input.deinit();
+13
src/widgets/TextInput.zig
··· 595 595 try std.testing.expectEqualStrings("-latte", input.buf.secondHalf()); 596 596 } 597 597 598 + test "non-ASCII punctuation treated as word chars" { 599 + var input = TextInput.init(std.testing.allocator); 600 + defer input.deinit(); 601 + // Em dash (U+2014, 3 bytes: E2 80 94) has bytes >= 0x80, so all bytes are 602 + // classified as word chars. The entire string is one continuous "word" — the 603 + // em dash does NOT act as a separator. This is a known limitation of the 604 + // byte-based classifier; proper Unicode category classification would be 605 + // needed to treat non-ASCII punctuation as separators. 606 + try input.insertSliceAtCursor("hello\xe2\x80\x94world"); 607 + input.moveBackwardWordwise(); 608 + try std.testing.expectEqualStrings("", input.buf.firstHalf()); 609 + } 610 + 598 611 test "deleteWordBefore with non-ASCII text" { 599 612 var input = TextInput.init(std.testing.allocator); 600 613 defer input.deinit();