(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: { (DQ <'Test the svn importer\'s input handling routines.\n'> <'\n'> <'These tests provide some simple checks that the line_buffer API\n'> <'behaves as advertised.\n'> <'\n'> <'While at it, check that input of newlines and null bytes are handled\n'> <'correctly.\n'> ) } spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'hello world'>)} { (SQ <'\n'> <'\techo ">HELLO" >expect &&\n'> <'\ttest-line-buffer <<-\\EOF >actual &&\n'> <'\tbinary 6\n'> <'\tHELLO\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'0-length read, send along greeting'>)} { (SQ <'\n'> <'\techo ">HELLO" >expect &&\n'> <'\ttest-line-buffer <<-\\EOF >actual &&\n'> <'\tbinary 0\n'> <'\tcopy 6\n'> <'\tHELLO\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'read from file descriptor'>)} { (SQ <'\n'> <'\trm -f input &&\n'> <'\techo hello >expect &&\n'> <'\techo hello >input &&\n'> <'\techo copy 6 |\n'> <'\ttest-line-buffer "&4" 4<input >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'skip, copy null byte'>)} { (SQ <'\n'> <'\techo Q | q_to_nul >expect &&\n'> <'\tq_to_nul <<-\\EOF | test-line-buffer >actual &&\n'> <'\tskip 2\n'> <'\tQ\n'> <'\tcopy 2\n'> <'\tQ\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'read null byte'>)} { (SQ <'\n'> <'\techo ">QhelloQ" | q_to_nul >expect &&\n'> <'\tq_to_nul <<-\\EOF | test-line-buffer >actual &&\n'> <'\tbinary 8\n'> <'\tQhelloQ\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'long reads are truncated'>)} { (SQ <'\n'> <'\techo ">foo" >expect &&\n'> <'\ttest-line-buffer <<-\\EOF >actual &&\n'> <'\tbinary 5\n'> <'\tfoo\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'long copies are truncated'>)} { (SQ <'\n'> <'\tprintf "%s\\n" ">" foo >expect &&\n'> <'\ttest-line-buffer <<-\\EOF >actual &&\n'> <'\tbinary 1\n'> <'\n'> <'\tcopy 5\n'> <'\tfoo\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'long binary reads are truncated'>)} { (SQ <'\n'> <'\techo ">foo" >expect &&\n'> <'\ttest-line-buffer <<-\\EOF >actual &&\n'> <'\tbinary 5\n'> <'\tfoo\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_done>}) ] )