| test_description="Test the svn importer's input handling routines. |
| These tests provide some simple checks that the line_buffer API |
| While at it, check that input of newlines and null bytes are handled |
| test_expect_success 'hello world' ' |
| test-line-buffer <<-\EOF >actual && |
| test_expect_success '0-length read, send along greeting' ' |
| test-line-buffer <<-\EOF >actual && |
| test_expect_success 'read from file descriptor' ' |
| test-line-buffer "&4" 4<input >actual && |
| test_expect_success 'skip, copy null byte' ' |
| echo Q | q_to_nul >expect && |
| q_to_nul <<-\EOF | test-line-buffer >actual && |
| test_expect_success 'read null byte' ' |
| echo ">QhelloQ" | q_to_nul >expect && |
| q_to_nul <<-\EOF | test-line-buffer >actual && |
| test_expect_success 'long reads are truncated' ' |
| test-line-buffer <<-\EOF >actual && |
| test_expect_success 'long copies are truncated' ' |
| printf "%s\n" ">" foo >expect && |
| test-line-buffer <<-\EOF >actual && |
| test_expect_success 'long binary reads are truncated' ' |
| test-line-buffer <<-\EOF >actual && |