Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ward committed Jan 2, 2025
1 parent 82737c2 commit b2345f7
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions lsv/natural_compare_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@ fn test_numbers_embdded_in_text() {
a := 'log10.txt'
b := 'log9.txt'

assert compare_strings(&b, &a) > 0
assert natural_compare(&b, &a) < 0
assert string_compare(&b, &a, false) > 0
assert natural_compare(&b, &a, false) < 0

assert compare_strings(&a, &b) < 0
assert natural_compare(&a, &b) > 0
assert string_compare(&a, &b, false) < 0
assert natural_compare(&a, &b, false) > 0

assert compare_strings(&a, &a) == 0
assert natural_compare(&a, &a) == 0
assert string_compare(&a, &a, false) == 0
assert natural_compare(&a, &a, false) == 0

assert compare_strings(&b, &b) == 0
assert natural_compare(&b, &b) == 0
assert string_compare(&b, &b, false) == 0
assert natural_compare(&b, &b, false) == 0
}

fn test_numbers_two_embdded_in_text() {
a := '0log10.txt'
b := '1log9.txt'

assert compare_strings(&a, &b) < 0
assert natural_compare(&a, &b) < 0
assert string_compare(&a, &b, false) < 0
assert natural_compare(&a, &b, false) < 0

assert compare_strings(&b, &a) > 0
assert natural_compare(&b, &a) > 0
assert string_compare(&b, &a, false) > 0
assert natural_compare(&b, &a, false) > 0

assert compare_strings(&a, &a) == 0
assert natural_compare(&a, &a) == 0
assert string_compare(&a, &a, false) == 0
assert natural_compare(&b, &b, false) == 0

assert compare_strings(&b, &b) == 0
assert natural_compare(&b, &b) == 0
assert string_compare(&b, &b, false) == 0
assert natural_compare(&b, &b, false) == 0
}

fn test_no_numbers_in_text() {
a := 'abc'
b := 'bca'

assert compare_strings(&a, &b) < 0
assert natural_compare(&a, &b) < 0
assert string_compare(&a, &b, false) < 0
assert natural_compare(&a, &b, false) < 0

assert compare_strings(&b, &a) > 0
assert natural_compare(&b, &a) > 0
assert string_compare(&b, &a, false) > 0
assert natural_compare(&b, &a, false) > 0

assert compare_strings(&a, &a) == 0
assert natural_compare(&a, &a) == 0
assert string_compare(&a, &a, false) == 0
assert natural_compare(&b, &b, false) == 0

assert compare_strings(&b, &b) == 0
assert natural_compare(&b, &b) == 0
assert string_compare(&b, &b, false) == 0
assert natural_compare(&b, &b, false) == 0
}

0 comments on commit b2345f7

Please sign in to comment.