Jeff Hostetler | a6db3fb | 2017-04-14 19:12:28 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='Test strcmp_offset functionality' |
| 4 | |
Ævar Arnfjörð Bjarmason | fdc8f79 | 2021-10-12 15:56:38 +0200 | [diff] [blame] | 5 | TEST_PASSES_SANITIZE_LEAK=true |
Jeff Hostetler | a6db3fb | 2017-04-14 19:12:28 +0000 | [diff] [blame] | 6 | . ./test-lib.sh |
| 7 | |
| 8 | while read s1 s2 expect |
| 9 | do |
| 10 | test_expect_success "strcmp_offset($s1, $s2)" ' |
| 11 | echo "$expect" >expect && |
Nguyễn Thái Ngọc Duy | 1a5f3d7 | 2018-03-24 08:44:59 +0100 | [diff] [blame] | 12 | test-tool strcmp-offset "$s1" "$s2" >actual && |
Jeff Hostetler | a6db3fb | 2017-04-14 19:12:28 +0000 | [diff] [blame] | 13 | test_cmp expect actual |
| 14 | ' |
| 15 | done <<-EOF |
| 16 | abc abc 0 3 |
| 17 | abc def -1 0 |
| 18 | abc abz -1 2 |
| 19 | abc abcdef -1 3 |
| 20 | EOF |
| 21 | |
| 22 | test_done |