3 test_description
="Test the svn importer's input handling routines.
7 test_expect_success
'read greeting' '
9 test-line-buffer <<-\EOF >actual &&
13 test_cmp expect actual
16 test_expect_success
'0-length read, send along greeting' '
17 printf "%s\n" "" HELLO >expect &&
18 test-line-buffer <<-\EOF >actual &&
24 test_cmp expect actual
27 test_expect_success
'buffer_read_string copes with trailing null byte' '
29 q_to_nul <<-\EOF | test-line-buffer >actual &&
33 test_cmp expect actual
36 test_expect_success
'0-length read, copy null byte' '
37 printf "%s\n" "" Q | q_to_nul >expect &&
38 q_to_nul <<-\EOF | test-line-buffer >actual &&
44 test_cmp expect actual
47 test_expect_success
'long reads are truncated' '
48 printf "%s\n" foo "" >expect &&
49 test-line-buffer <<-\EOF >actual &&
53 test_cmp expect actual
56 test_expect_success
'long copies are truncated' '
57 printf "%s\n" "" foo >expect &&
58 test-line-buffer <<-\EOF >actual &&
64 test_cmp expect actual