Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/test_fqn.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,19 @@ TEST(project_name_encodes_unicode_segments_issue571) {
PASS();
}

TEST(project_name_unicode_segments_do_not_collide_issue571) {
char *first = cbm_project_name_from_path("/Users/dev/\xe5\xbc\x80\xe5\x8f\x91");
char *second = cbm_project_name_from_path("/Users/dev/\xe5\x90\x8e\xe7\xab\xaf");
ASSERT_NOT_NULL(first);
ASSERT_NOT_NULL(second);
ASSERT_STR_NEQ(first, second);
ASSERT_TRUE(cbm_validate_project_name(first));
ASSERT_TRUE(cbm_validate_project_name(second));
free(first);
free(second);
PASS();
}

/* issue #624: #571 preserves non-ASCII path segments by hex-encoding each byte
* (1 byte -> 2 hex chars), so a DEEP non-ASCII path triples in length and can
* blow past the filesystem's 255-byte filename-component limit. Then
Expand Down Expand Up @@ -780,6 +793,7 @@ SUITE(fqn) {
RUN_TEST(project_name_deep_path);
RUN_TEST(project_name_always_validator_safe_issue349);
RUN_TEST(project_name_encodes_unicode_segments_issue571);
RUN_TEST(project_name_unicode_segments_do_not_collide_issue571);
RUN_TEST(project_name_length_capped_issue624);
RUN_TEST(project_name_colon_only);
RUN_TEST(project_name_backslash_only);
Expand Down
Loading