diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2025-06-30 11:53:53 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-30 11:53:53 -0400 | 
| commit | 9c85b01ce13fae21f45719c18483cb65f2874a67 (patch) | |
| tree | 0a843126ae567cae9494aa19df6d2f353ee55b6a /tests | |
| parent | 1c78b0077bce9f0ebf7ab472ba4fa8c2c0169ff8 (diff) | |
| parent | 25e9ffa5dfe2e17498b58e7e73d1569abea314bb (diff) | |
| download | stasis-9c85b01ce13fae21f45719c18483cb65f2874a67.tar.gz | |
Merge pull request #112 from jhunkeler/bug-fixes-again
to_short_version: drop any values beyond "major.minor"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_str.c | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_str.c b/tests/test_str.c index ad0c07a..a98a34d 100644 --- a/tests/test_str.c +++ b/tests/test_str.c @@ -6,16 +6,17 @@ void test_to_short_version() {          const char *expected;      }; -    struct testcase tc[] = { -            {.data = "1.2.3", .expected = "123"}, +    const struct testcase tc[] = { +            {.data = "1.2.3", .expected = "12"},              {.data = "py3.12", .expected = "py312"}, -            {.data = "generic-1.2.3", .expected = "generic-123"}, +            {.data = "generic-1.2.3", .expected = "generic-12"},              {.data = "nothing to do", .expected = "nothing to do"},      };      for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) {          char *result = to_short_version(tc[i].data);          STASIS_ASSERT_FATAL(result != NULL, "should not be NULL"); +        //printf("%s[%zu], result: %s, expected: %s\n", __FUNCTION__, i, result, tc[i].expected);          STASIS_ASSERT(strcmp(result, tc[i].expected) == 0, "unexpected result");          guard_free(result);      }  | 
