|
143 | 143 | assert_exec_equals \
|
144 | 144 | "cd .. ; ./bin/rbt -b '*BEGIN*' -e '*END*' -r 'new text here' < /tmp/lorem_ipsum" \
|
145 | 145 | "${EXPECTED}" \
|
146 |
| - "#6: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin)." |
| 146 | + "#6: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin)" |
147 | 147 |
|
148 | 148 |
|
149 | 149 | ################################################################################################################
|
|
169 | 169 | assert_exec_equals \
|
170 | 170 | "cd .. ; ./bin/rbt -b '*BEGIN*' -e '*END*' -r 'new text here' < /tmp/lorem_ipsum" \
|
171 | 171 | "${EXPECTED}" \
|
172 |
| - "#7: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin and before end)." |
| 172 | + "#7: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin and before end)" |
173 | 173 |
|
174 | 174 |
|
175 | 175 | ################################################################################################################
|
|
193 | 193 | assert_exec_equals \
|
194 | 194 | "cd .. ; ./bin/rbt -b '*BEGIN*' -e '*END*' -r 'new text here' < /tmp/lorem_ipsum" \
|
195 | 195 | "${EXPECTED}" \
|
196 |
| - "#8: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin)." |
| 196 | + "#8: Two blocks on non consecutive lines. The second block is on two lines (force LF after begin)" |
197 | 197 |
|
198 | 198 |
|
199 | 199 | ################################################################################################################
|
|
215 | 215 | assert_exec_equals \
|
216 | 216 | "cd .. ; ./bin/rbt -b '*BEGIN*' -e '*END*' -r 'new text here' < /tmp/lorem_ipsum" \
|
217 | 217 | "${EXPECTED}" \
|
218 |
| - "#9: Two blocks with end of the first block/begin of the second block are on the same line." |
| 218 | + "#9: Two blocks with end of the first block/begin of the second block are on the same line" |
219 | 219 |
|
220 | 220 |
|
221 | 221 | ################################################################################################################
|
@@ -390,6 +390,89 @@ assert_exec_equals \
|
390 | 390 |
|
391 | 391 | rm -f /tmp/lorem_ipsum
|
392 | 392 |
|
| 393 | +################################################################################################################ |
| 394 | + |
| 395 | +cat > /tmp/lorem_ipsum <<'EOF' |
| 396 | +texte sans rien |
| 397 | +-- |
| 398 | +texte avec un ~tag~ en plein milieu |
| 399 | +-- |
| 400 | +~tag~ au début |
| 401 | +-- |
| 402 | +la fin se termine par ~tag~ |
| 403 | +-- |
| 404 | +~tag~ |
| 405 | +-- |
| 406 | +la fin se termine par ~tag~ |
| 407 | +-- |
| 408 | +la fin se termine par ~tag |
| 409 | +sur deux lignes~ |
| 410 | +-- |
| 411 | +la fin se termine par ~tag |
| 412 | +sur deux lignes~ avec texte après |
| 413 | +-- |
| 414 | +~tag |
| 415 | +sur deux lignes~ |
| 416 | +-- |
| 417 | +~tag |
| 418 | +sur deux lignes~ avec texte après |
| 419 | +-- |
| 420 | +deux ~tag1~ et ~tag2~ |
| 421 | +-- |
| 422 | +deux ~tag1~ et ~tag sur |
| 423 | +ligne suivante~ |
| 424 | +-- |
| 425 | +entre |
| 426 | +~ |
| 427 | +texte à |
| 428 | +changer |
| 429 | +~ |
| 430 | +EOF |
| 431 | + |
| 432 | +read -r -d '' EXPECTED <<'EOF' |
| 433 | +texte sans rien |
| 434 | +-- |
| 435 | +texte avec un /* tag */ en plein milieu |
| 436 | +-- |
| 437 | +/* tag */ au début |
| 438 | +-- |
| 439 | +la fin se termine par /* tag */ |
| 440 | +-- |
| 441 | +/* tag */ |
| 442 | +-- |
| 443 | +la fin se termine par /* tag */ |
| 444 | +-- |
| 445 | +la fin se termine par /* tag |
| 446 | +sur deux lignes */ |
| 447 | +-- |
| 448 | +la fin se termine par /* tag |
| 449 | +sur deux lignes */ avec texte après |
| 450 | +-- |
| 451 | +/* tag |
| 452 | +sur deux lignes */ |
| 453 | +-- |
| 454 | +/* tag |
| 455 | +sur deux lignes */ avec texte après |
| 456 | +-- |
| 457 | +deux /* tag1 */ et /* tag2 */ |
| 458 | +-- |
| 459 | +deux /* tag1 */ et /* tag sur |
| 460 | +ligne suivante */ |
| 461 | +-- |
| 462 | +entre |
| 463 | +
|
| 464 | +/* texte à |
| 465 | +changer */ |
| 466 | +
|
| 467 | +EOF |
| 468 | + |
| 469 | +assert_exec_equals \ |
| 470 | + "cd .. ; ./bin/rbt -b '~' -e '~' --comment java-block -d < /tmp/lorem_ipsum" \ |
| 471 | + "${EXPECTED}" \ |
| 472 | + "#15: Several tests with comment /* */ (begin and end strings are equal), begin/end strings are deleted" |
| 473 | + |
| 474 | +rm -f /tmp/lorem_ipsum |
| 475 | + |
393 | 476 | echo "${ok}/${total} (${ko} errors)"
|
394 | 477 |
|
395 | 478 | #rm -f /tmp/lorem_ipsum
|
|
0 commit comments