Skip to content

Commit

Permalink
Add new tests for substitute overflow + callout combo
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Dec 19, 2024
1 parent f15bdd3 commit c63bfd5
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
32 changes: 32 additions & 0 deletions testdata/testinput2
Original file line number Diff line number Diff line change
Expand Up @@ -5805,6 +5805,38 @@ a)"xI
12abc34xyz\=substitute_skip=1
12abc34xyz\=substitute_stop=1

/a(b)c/substitute_overflow_length,substitute_callout,replace=[1]12
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[2]12
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[3]12
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[4]12
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[2]1234
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[3]1234
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[4]1234
abc\=substitute_skip=1
abc

/a(b)c/substitute_overflow_length,substitute_callout,replace=[5]1234
abc\=substitute_skip=1
abc

/abc\rdef/
abc\ndef

Expand Down
58 changes: 58 additions & 0 deletions testdata/testoutput2
Original file line number Diff line number Diff line change
Expand Up @@ -17419,6 +17419,64 @@ Subject length lower bound = 1
1(2) Old 2 5 "abc" New 2 7 "<abc> STOPPED"
1: 12abc34xyz

/a(b)c/substitute_overflow_length,substitute_callout,replace=[1]12
abc\=substitute_skip=1
Failed: error -48: no more memory: 3 code units are needed
abc
Failed: error -48: no more memory: 3 code units are needed

/a(b)c/substitute_overflow_length,substitute_callout,replace=[2]12
abc\=substitute_skip=1
1(2) Old 0 3 "abc" New 0 2 "12 SKIPPED"
Failed: error -48: no more memory: 4 code units are needed
abc
1(2) Old 0 3 "abc" New 0 2 "12"
Failed: error -48: no more memory: 3 code units are needed

/a(b)c/substitute_overflow_length,substitute_callout,replace=[3]12
abc\=substitute_skip=1
1(2) Old 0 3 "abc" New 0 2 "12 SKIPPED"
Failed: error -48: no more memory: 4 code units are needed
abc
1(2) Old 0 3 "abc" New 0 2 "12"
1: 12

/a(b)c/substitute_overflow_length,substitute_callout,replace=[4]12
abc\=substitute_skip=1
1(2) Old 0 3 "abc" New 0 2 "12 SKIPPED"
1: abc
abc
1(2) Old 0 3 "abc" New 0 2 "12"
1: 12

/a(b)c/substitute_overflow_length,substitute_callout,replace=[2]1234
abc\=substitute_skip=1
Failed: error -48: no more memory: 5 code units are needed
abc
Failed: error -48: no more memory: 5 code units are needed

/a(b)c/substitute_overflow_length,substitute_callout,replace=[3]1234
abc\=substitute_skip=1
Failed: error -48: no more memory: 5 code units are needed
abc
Failed: error -48: no more memory: 5 code units are needed

/a(b)c/substitute_overflow_length,substitute_callout,replace=[4]1234
abc\=substitute_skip=1
1(2) Old 0 3 "abc" New 0 4 "1234 SKIPPED"
1: abc
abc
1(2) Old 0 3 "abc" New 0 4 "1234"
Failed: error -48: no more memory: 5 code units are needed

/a(b)c/substitute_overflow_length,substitute_callout,replace=[5]1234
abc\=substitute_skip=1
1(2) Old 0 3 "abc" New 0 4 "1234 SKIPPED"
1: abc
abc
1(2) Old 0 3 "abc" New 0 4 "1234"
1: 1234

/abc\rdef/
abc\ndef
No match
Expand Down

0 comments on commit c63bfd5

Please sign in to comment.