blob: 94e34c83ed96d86b096385610565a3179f7a9f1c [file] [log] [blame]
Jeff Hostetlera6db3fb2017-04-14 19:12:28 +00001#!/bin/sh
2
3test_description='Test strcmp_offset functionality'
4
Ævar Arnfjörð Bjarmasonfdc8f792021-10-12 15:56:38 +02005TEST_PASSES_SANITIZE_LEAK=true
Jeff Hostetlera6db3fb2017-04-14 19:12:28 +00006. ./test-lib.sh
7
8while read s1 s2 expect
9do
10 test_expect_success "strcmp_offset($s1, $s2)" '
11 echo "$expect" >expect &&
Nguyễn Thái Ngọc Duy1a5f3d72018-03-24 08:44:59 +010012 test-tool strcmp-offset "$s1" "$s2" >actual &&
Jeff Hostetlera6db3fb2017-04-14 19:12:28 +000013 test_cmp expect actual
14 '
15done <<-EOF
16abc abc 0 3
17abc def -1 0
18abc abz -1 2
19abc abcdef -1 3
20EOF
21
22test_done