diff options
Diffstat (limited to 'test/norm.c')
| -rw-r--r-- | test/norm.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/norm.c b/test/norm.c index acfb6ec..4b8a35a 100644 --- a/test/norm.c +++ b/test/norm.c @@ -1,10 +1,5 @@ -/* norm.c - Refs and repositories have one spelling each internally. This is the file - * that pins "main", "heads/main" and "refs/heads/main" being one branch, and - * a bare name never meaning a tag. - * - * Part of the direct suite: this links the library, not the command - * line. test/run.sh is the other half, and drives the program the way git does. - */ +// One spelling per ref: "main", "heads/main" and "refs/heads/main" are one +// branch, and a bare name is never a tag. #include "test.h" static void test_normalisation(void) @@ -21,7 +16,7 @@ static void test_normalisation(void) CHECK_STR(s, "refs/heads/main"); free(s); s = authz_norm_ref("v1.0"); - CHECK_STR(s, "refs/heads/v1.0"); /* a bare name is never a tag */ + CHECK_STR(s, "refs/heads/v1.0"); // a bare name is never a tag free(s); s = authz_norm_ref("tags/v1.0"); CHECK_STR(s, "refs/tags/v1.0"); @@ -49,7 +44,7 @@ static void test_normalisation(void) CHECK_STR(s, "*"); free(s); s = authz_norm_repo(".git"); - CHECK_STR(s, ".git"); /* a repository called ".git" is not a suffix */ + CHECK_STR(s, ".git"); // a repository called ".git" is not a suffix free(s); CHECK_INT(authz_level_of("write"), LV_WRITE); @@ -66,13 +61,13 @@ static void test_normalisation(void) CHECK(authz_user_pattern_ok("@all")); CHECK(authz_user_pattern_ok("a[bc]d")); CHECK(!authz_user_pattern_ok("")); - CHECK(!authz_user_pattern_ok("a/b")); /* a path is not a user name */ + CHECK(!authz_user_pattern_ok("a/b")); // a path is not a user name CHECK(!authz_user_pattern_ok("a$b")); CHECK(!authz_user_pattern_ok("-x")); CHECK(authz_repo_pattern_ok("team")); CHECK(authz_repo_pattern_ok("*")); CHECK(authz_repo_pattern_ok("team-*")); - CHECK(!authz_repo_pattern_ok("group/team")); /* flat names only */ + CHECK(!authz_repo_pattern_ok("group/team")); // flat names only CHECK(!authz_repo_pattern_ok("")); CHECK(!authz_repo_pattern_ok("a$b")); } |
