├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── PatternsOnText.manifest ├── README.md ├── autoload ├── PatternsOnText.vim └── PatternsOnText │ ├── Choices.vim │ ├── DuplicateLines.vim │ ├── Duplicates.vim │ ├── Except.vim │ ├── Execute.vim │ ├── If.vim │ ├── InSearch.vim │ ├── Pairs.vim │ ├── PairsExpr.vim │ ├── Ranges.vim │ ├── Renumber.vim │ ├── Rotate.vim │ ├── Selected.vim │ ├── Subsequent.vim │ ├── Transactional.vim │ ├── Transactional │ ├── Common.vim │ ├── Expr.vim │ └── ExprEach.vim │ ├── Translate.vim │ ├── UnderCursor.vim │ └── Uniques.vim ├── doc └── PatternsOnText.txt ├── plugin └── PatternsOnText.vim └── tests ├── _setup.vim ├── duplicateAndEmptyLines.txt ├── duplicateLines.txt ├── duplicates.txt ├── enumeration.txt ├── numbers.txt ├── ranges.txt ├── t1000-PrintDuplicateLinesOf.msgok ├── t1000-PrintDuplicateLinesOf.vim ├── t1010-PrintDuplicateLinesOf-error.vim ├── t1015-PrintDuplicateLinesOf-bar.vim ├── t1020-PrintDuplicateLinesOf-pattern.msgok ├── t1020-PrintDuplicateLinesOf-pattern.vim ├── t1030-PrintDuplicateLinesOf-jumplist.vim ├── t1040-PrintDuplicateLinesOf-range.msgok ├── t1040-PrintDuplicateLinesOf-range.vim ├── t1050-PrintDuplicateLinesOf-empty-lines.msgok ├── t1050-PrintDuplicateLinesOf-empty-lines.vim ├── t1080-PrintDuplicateLinesOf-inverted.msgok ├── t1080-PrintDuplicateLinesOf-inverted.vim ├── t1090-PrintDuplicateLinesOf-inverted-pattern.msgok ├── t1090-PrintDuplicateLinesOf-inverted-pattern.vim ├── t1100-DeleteDuplicateLinesOf.ok ├── t1100-DeleteDuplicateLinesOf.vim ├── t1110-DeleteDuplicateLinesOf-error-unmodifiable.vim ├── t1115-DeleteDuplicateLinesOf-bar.vim ├── t1150-DeleteDuplicateLinesOf-empty-lines.ok ├── t1150-DeleteDuplicateLinesOf-empty-lines.vim ├── t1170-DeleteDuplicateLinesOf-fold.ok ├── t1170-DeleteDuplicateLinesOf-fold.vim ├── t1190-DeleteDuplicateLinesOf-inverted.ok ├── t1190-DeleteDuplicateLinesOf-inverted.vim ├── t1510-PrintUniqueLinesOf-error.vim ├── t1520-PrintUniqueLinesOf-pattern.msgok ├── t1520-PrintUniqueLinesOf-pattern.vim ├── t1540-PrintUniqueLinesOf-range.msgok ├── t1540-PrintUniqueLinesOf-range.vim ├── t1590-PrintUniqueLinesOf-inverted-pattern.msgok ├── t1590-PrintUniqueLinesOf-inverted-pattern.vim ├── t1615-DeleteUniqueLinesOf-bar.ok ├── t1615-DeleteUniqueLinesOf-bar.vim ├── t2000-PrintDuplicateLinesIgnoring.msgok ├── t2000-PrintDuplicateLinesIgnoring.vim ├── t2010-PrintDuplicateLinesIgnoring-error.vim ├── t2015-PrintDuplicateLinesIgnoring-bar.vim ├── t2020-PrintDuplicateLinesIgnoring-pattern.msgok ├── t2020-PrintDuplicateLinesIgnoring-pattern.vim ├── t2030-PrintDuplicateLinesIgnoring-jumplist.vim ├── t2040-PrintDuplicateLinesIgnoring-range.msgok ├── t2040-PrintDuplicateLinesIgnoring-range.vim ├── t2050-PrintDuplicateLinesIgnoring-empty-lines.msgok ├── t2050-PrintDuplicateLinesIgnoring-empty-lines.vim ├── t2080-PrintDuplicateLinesIgnoring-inverted.msgok ├── t2080-PrintDuplicateLinesIgnoring-inverted.vim ├── t2090-PrintDuplicateLinesIgnoring-inverted-pattern.msgok ├── t2090-PrintDuplicateLinesIgnoring-inverted-pattern.vim ├── t2100-DeleteDuplicateLinesIgnoring.msgok ├── t2100-DeleteDuplicateLinesIgnoring.ok ├── t2100-DeleteDuplicateLinesIgnoring.vim ├── t2115-DeleteDuplicateLinesIgnoring-bar.vim ├── t2150-DeleteDuplicateLinesIgnoring-empty-lines.ok ├── t2150-DeleteDuplicateLinesIgnoring-empty-lines.vim ├── t2190-DeleteDuplicateLinesIgnoring-inverted-pattern.ok ├── t2190-DeleteDuplicateLinesIgnoring-inverted-pattern.vim ├── t2200-DeleteAllDuplicateLinesIgnoring.ok ├── t2200-DeleteAllDuplicateLinesIgnoring.vim ├── t2220-DeleteAllDuplicateLinesIgnoring-pattern.ok ├── t2220-DeleteAllDuplicateLinesIgnoring-pattern.vim ├── t2250-DeleteAllDuplicateLinesIgnoring-empty-lines.ok ├── t2250-DeleteAllDuplicateLinesIgnoring-empty-lines.vim ├── t2270-DeleteAllDuplicateLinesIgnoring-fold.ok ├── t2270-DeleteAllDuplicateLinesIgnoring-fold.vim ├── t2280-DeleteAllDuplicateLinesIgnoring-inverted.ok ├── t2280-DeleteAllDuplicateLinesIgnoring-inverted.vim ├── t2290-DeleteAllDuplicateLinesIgnoring-inverted-pattern.ok ├── t2290-DeleteAllDuplicateLinesIgnoring-inverted-pattern.vim ├── t2500-PrintUniqueLinesIgnoring.msgok ├── t2500-PrintUniqueLinesIgnoring.vim ├── t2510-PrintUniqueLinesIgnoring-error.vim ├── t2520-PrintUniqueLinesIgnoring-pattern.msgok ├── t2520-PrintUniqueLinesIgnoring-pattern.vim ├── t2530-PrintUniqueLinesIgnoring-jumplist.vim ├── t2540-PrintUniqueLinesIgnoring-range.msgok ├── t2540-PrintUniqueLinesIgnoring-range.vim ├── t2580-PrintUniqueLinesIgnoring-inverted.msgok ├── t2580-PrintUniqueLinesIgnoring-inverted.vim ├── t2590-PrintUniqueLinesIgnoring-inverted-pattern.msgok ├── t2590-PrintUniqueLinesIgnoring-inverted-pattern.vim ├── t2600-DeleteUniqueLinesIgnoring.vim ├── t3000-PrintDuplicates.msgok ├── t3000-PrintDuplicates.vim ├── t3010-PrintDuplicates-range.msgok ├── t3010-PrintDuplicates-range.vim ├── t3015-PrintDuplicates-bar.vim ├── t3020-PrintDuplicates-buffer.msgok ├── t3020-PrintDuplicates-buffer.vim ├── t3030-PrintDuplicates-pattern.msgok ├── t3030-PrintDuplicates-pattern.vim ├── t3070-PrintDuplicates-fold.msgok ├── t3070-PrintDuplicates-fold.vim ├── t3115-DeleteDuplicates-bar.vim ├── t3130-DeleteDuplicates-pattern.msgok ├── t3130-DeleteDuplicates-pattern.ok ├── t3130-DeleteDuplicates-pattern.vim ├── t3140-DeleteDuplicates-range.msgok ├── t3140-DeleteDuplicates-range.ok ├── t3140-DeleteDuplicates-range.vim ├── t3150-DeleteDuplicates.ok ├── t3150-DeleteDuplicates.vim ├── t3500-PrintUniques.msgok ├── t3500-PrintUniques.vim ├── t3510-PrintUniques-range.msgok ├── t3510-PrintUniques-range.vim ├── t3520-PrintUniques-buffer.msgok ├── t3520-PrintUniques-buffer.vim ├── t3610-DeleteUniques-error.vim ├── t3630-DeleteUniques-pattern.msgok ├── t3630-DeleteUniques-pattern.ok ├── t3630-DeleteUniques-pattern.vim ├── t3640-DeleteUniques-range.msgok ├── t3640-DeleteUniques-range.ok ├── t3640-DeleteUniques-range.vim ├── t3650-DeleteUniques.msgok ├── t3650-DeleteUniques.ok ├── t3650-DeleteUniques.vim ├── t3710-DeleteAllDuplicates-error.vim ├── t3730-DeleteAllDuplicates-pattern.ok ├── t3730-DeleteAllDuplicates-pattern.vim ├── t3740-DeleteAllDuplicates-range.ok ├── t3740-DeleteAllDuplicates-range.vim ├── t3750-DeleteAllDuplicates.ok ├── t3750-DeleteAllDuplicates.vim ├── t4000-SubstituteSelected-line.ok ├── t4000-SubstituteSelected-line.vim ├── t4010-SubstituteSelected-buffer.ok ├── t4010-SubstituteSelected-buffer.vim ├── t4015-SubstituteSelected-bar.vim ├── t4020-SubstituteSelected-bad-answers.vim ├── t4030-SubstituteSelected-no-matches.vim ├── t4040-SubstituteSelected-replacements.ok ├── t4040-SubstituteSelected-replacements.vim ├── t4045-SubstituteSelected-replacements-escaping.ok ├── t4045-SubstituteSelected-replacements-escaping.vim ├── t4047-SubstituteSelected-replacements-expr.ok ├── t4047-SubstituteSelected-replacements-expr.vim ├── t4050-SubstituteSelected-answer-parsing.vim ├── t4060-SubstituteSelected-complex-answer.ok ├── t4060-SubstituteSelected-complex-answer.vim ├── t4070-SubstituteSelected-repeat.ok ├── t4070-SubstituteSelected-repeat.vim ├── t4080-SubstituteSelected-repeat-answers.ok ├── t4080-SubstituteSelected-repeat-answers.vim ├── t4090-SubstituteSelected-cursor-position.vim ├── t4100-SubstituteUnderCursor.ok ├── t4100-SubstituteUnderCursor.vim ├── t4110-SubstituteUnderCursor-previous-search.ok ├── t4110-SubstituteUnderCursor-previous-search.vim ├── t4120-SubstituteUnderCursor-repeat.ok ├── t4120-SubstituteUnderCursor-repeat.vim ├── t4125-SubstituteUnderCursor-repeat-flags.ok ├── t4125-SubstituteUnderCursor-repeat-flags.vim ├── t4130-SubstituteUnderCursor-no-matches.vim ├── t4135-SubstituteUnderCursor-no-previous-pattern.vim ├── t4140-SubstituteUnderCursor-range-error.vim ├── t5000-SubstituteInSearch-line.ok ├── t5000-SubstituteInSearch-line.vim ├── t5010-SubstituteInSearch-buffer.msgok ├── t5010-SubstituteInSearch-buffer.ok ├── t5010-SubstituteInSearch-buffer.vim ├── t5015-SubstituteInSearch-bar.vim ├── t5020-SubstituteInSearch-outer-flags.ok ├── t5020-SubstituteInSearch-outer-flags.vim ├── t5030-SubstituteInSearch-inner-flags.ok ├── t5030-SubstituteInSearch-inner-flags.vim ├── t5040-SubstituteInSearch-count.ok ├── t5040-SubstituteInSearch-count.vim ├── t5050-SubstituteInSearch-same-replacement.ok ├── t5050-SubstituteInSearch-same-replacement.vim ├── t5060-SubstituteInSearch-repeat.ok ├── t5060-SubstituteInSearch-repeat.vim ├── t5070-SubstituteInSearch-no-outer-matches.vim ├── t5080-SubstituteInSearch-no-inner-matches.vim ├── t5090-SubstituteInSearch-no-inner-matches-suppression.msgok ├── t5090-SubstituteInSearch-no-inner-matches-suppression.vim ├── t5100-SubstituteInSearch-replacements-expr.ok ├── t5100-SubstituteInSearch-replacements-expr.vim ├── t5110-SubstituteInSearch-inline.ok ├── t5110-SubstituteInSearch-inline.vim ├── t5120-SubstituteInSearch-inline-flags.ok ├── t5120-SubstituteInSearch-inline-flags.vim ├── t5150-SubstituteInSearch-inline-same-replacement.ok ├── t5150-SubstituteInSearch-inline-same-replacement.vim ├── t5160-SubstituteInSearch-inline-repeat.ok ├── t5160-SubstituteInSearch-inline-repeat.vim ├── t5170-SubstituteInSearch-inline-empty.ok ├── t5170-SubstituteInSearch-inline-empty.vim ├── t5200-SubstituteNotInSearch-line.ok ├── t5200-SubstituteNotInSearch-line.vim ├── t5210-SubstituteNotInSearch-buffer.ok ├── t5210-SubstituteNotInSearch-buffer.vim ├── t5220-SubstituteNotInSearch-outer-flags.ok ├── t5220-SubstituteNotInSearch-outer-flags.vim ├── t5225-SubstituteNotInSearch-previous-search.ok ├── t5225-SubstituteNotInSearch-previous-search.vim ├── t5230-SubstituteNotInSearch-inner-flags.ok ├── t5230-SubstituteNotInSearch-inner-flags.vim ├── t5270-SubstituteNotInSearch-no-outer-matches.ok ├── t5270-SubstituteNotInSearch-no-outer-matches.vim ├── t5275-SubstituteNotInSearch-all-outer-matches.vim ├── t5310-SubstituteNotInSearch-inline.ok ├── t5310-SubstituteNotInSearch-inline.vim ├── t5320-SubstituteNotInSearch-inline-flags.ok ├── t5320-SubstituteNotInSearch-inline-flags.vim ├── t6000-SubstituteExcept-line.ok ├── t6000-SubstituteExcept-line.vim ├── t6010-SubstituteExcept-buffer.ok ├── t6010-SubstituteExcept-buffer.vim ├── t6015-SubstituteExcept-bar.vim ├── t6020-SubstituteExcept-flags.ok ├── t6020-SubstituteExcept-flags.vim ├── t6030-SubstituteExcept-no-matches.ok ├── t6030-SubstituteExcept-no-matches.vim ├── t6040-SubstituteExcept-replacements.ok ├── t6040-SubstituteExcept-replacements.vim ├── t6050-SubstituteExcept-replacements-special.ok ├── t6050-SubstituteExcept-replacements-special.vim ├── t6060-SubstituteExcept-replacement-error.ok ├── t6060-SubstituteExcept-replacement-error.vim ├── t6070-SubstituteExcept-repeat.ok ├── t6070-SubstituteExcept-repeat.vim ├── t6075-SubstituteExcept-repeat-flags.ok ├── t6075-SubstituteExcept-repeat-flags.vim ├── t6080-SubstituteExcept-subst-repeat.ok ├── t6080-SubstituteExcept-subst-repeat.vim ├── t6090-SubstituteExcept-count.ok ├── t6090-SubstituteExcept-count.vim ├── t6100-DeleteExcept-line.ok ├── t6100-DeleteExcept-line.vim ├── t6110-DeleteExcept-buffer.ok ├── t6110-DeleteExcept-buffer.vim ├── t6115-DeleteExcept-bar.vim ├── t6120-DeleteExcept-flags.ok ├── t6120-DeleteExcept-flags.vim ├── t6130-DeleteExcept-no-matches.ok ├── t6130-DeleteExcept-no-matches.vim ├── t6180-DeleteExcept-subst-repeat.ok ├── t6180-DeleteExcept-subst-repeat.vim ├── t6190-DeleteExcept-magic-atoms.vim ├── t6191-DeleteExcept-zs-ze.vim ├── t7000-SubstituteWildcard-line.ok ├── t7000-SubstituteWildcard-line.vim ├── t7010-SubstituteWildcard-buffer.ok ├── t7010-SubstituteWildcard-buffer.vim ├── t7015-SubstituteWildcard-bar.vim ├── t7016-SubstituteWildcard-space.ok ├── t7016-SubstituteWildcard-space.vim ├── t7020-SubstituteWildcard-flags.ok ├── t7020-SubstituteWildcard-flags.vim ├── t7030-SubstituteWildcard-no-matches.vim ├── t7040-SubstituteWildcard-count.ok ├── t7040-SubstituteWildcard-count.vim ├── t7050-SubstituteWildcard-invalid-tuple.vim ├── t7060-SubstituteWildcard-order.ok ├── t7060-SubstituteWildcard-order.vim ├── t7070-SubstituteWildcard-wildcard-questionmark.ok ├── t7070-SubstituteWildcard-wildcard-questionmark.vim ├── t7080-SubstituteWildcard-wildcard-star.ok ├── t7080-SubstituteWildcard-wildcard-star.vim ├── t7090-SubstituteWildcard-wildcard-brackets.ok ├── t7090-SubstituteWildcard-wildcard-brackets.vim ├── t7100-SubstituteWildcard-reference-match.ok ├── t7100-SubstituteWildcard-reference-match.vim ├── t7110-SubstituteWildcard-repeat.ok ├── t7110-SubstituteWildcard-repeat.vim ├── t7120-SubstituteWildcard-expression.ok ├── t7120-SubstituteWildcard-expression.vim ├── t7500-SubstituteMultiple-line.ok ├── t7500-SubstituteMultiple-line.vim ├── t7505-SubstituteMultiple-escaping.ok ├── t7505-SubstituteMultiple-escaping.vim ├── t7510-SubstituteMultiple-buffer.ok ├── t7510-SubstituteMultiple-buffer.vim ├── t7515-SubstituteMultiple-bar.vim ├── t7516-SubstituteMultiple-space.ok ├── t7516-SubstituteMultiple-space.vim ├── t7520-SubstituteMultiple-flags.ok ├── t7520-SubstituteMultiple-flags.vim ├── t7530-SubstituteMultiple-no-matches.vim ├── t7540-SubstituteMultiple-count.ok ├── t7540-SubstituteMultiple-count.vim ├── t7550-SubstituteMultiple-minimal-pair.ok ├── t7550-SubstituteMultiple-minimal-pair.vim ├── t7560-SubstituteMultiple-order.ok ├── t7560-SubstituteMultiple-order.vim ├── t7570-SubstituteMultiple-separators.ok ├── t7570-SubstituteMultiple-separators.vim ├── t7580-SubstituteMultiple-magic.ok ├── t7580-SubstituteMultiple-magic.vim ├── t7590-SubstituteMultiple-capture-group.vim ├── t7600-SubstituteMultiple-reference-match.ok ├── t7600-SubstituteMultiple-reference-match.vim ├── t7610-SubstituteMultiple-repeat.ok ├── t7610-SubstituteMultiple-repeat.vim ├── t7620-SubstituteMultiple-expression.ok ├── t7620-SubstituteMultiple-expression.vim ├── t7630-SubstituteMultipleExpr-line.ok ├── t7630-SubstituteMultipleExpr-line.vim ├── t7640-SubstituteMultipleExpr-buffer.ok ├── t7640-SubstituteMultipleExpr-buffer.vim ├── t7642-SubstituteMultipleExpr-string-split.ok ├── t7642-SubstituteMultipleExpr-string-split.vim ├── t7644-SubstituteMultipleExpr-variable.ok ├── t7644-SubstituteMultipleExpr-variable.vim ├── t7646-SubstituteMultipleExpr-function.ok ├── t7646-SubstituteMultipleExpr-function.vim ├── t7650-SubstituteMultipleExpr-no-matches.vim ├── t7652-SubstituteMultipleExpr-no-patterns.vim ├── t7654-SubstituteMultipleExpr-capture-group.vim ├── t7656-SubstituteMultipleExpr-magic.ok ├── t7656-SubstituteMultipleExpr-magic.vim ├── t7660-SubstituteMultipleExpr-less-replacements.ok ├── t7660-SubstituteMultipleExpr-less-replacements.vim ├── t7670-SubstituteMultipleExpr-count.ok ├── t7670-SubstituteMultipleExpr-count.vim ├── t7680-SubstituteMultipleExpr-repeat.ok ├── t7680-SubstituteMultipleExpr-repeat.vim ├── t7682-SubstituteMultipleExpr-repeat-repl.ok ├── t7682-SubstituteMultipleExpr-repeat-repl.vim ├── t7690-SubstituteMultipleExpr-reference-match.ok ├── t7690-SubstituteMultipleExpr-reference-match.vim ├── t7695-SubstituteMultipleExpr-replacement-expr.ok ├── t7695-SubstituteMultipleExpr-replacement-expr.vim ├── t7700-SubstituteChoices-line.ok ├── t7700-SubstituteChoices-line.vim ├── t7710-SubstituteChoices-reference-match.ok ├── t7710-SubstituteChoices-reference-match.vim ├── t7720-SubstituteChoices-abort.ok ├── t7720-SubstituteChoices-abort.vim ├── t7730-SubstituteChoices-confirm-quit.ok ├── t7730-SubstituteChoices-confirm-quit.vim ├── t7731-SubstituteChoices-confirm-all-remaining.ok ├── t7731-SubstituteChoices-confirm-all-remaining.vim ├── t7732-SubstituteChoices-confirm-no.ok ├── t7732-SubstituteChoices-confirm-no.vim ├── t7733-SubstituteChoices-confirm-last.ok ├── t7733-SubstituteChoices-confirm-last.vim ├── t7740-SubstituteMultiple-error.vim ├── t7750-SubstituteChoices-escaping.ok ├── t7750-SubstituteChoices-escaping.vim ├── t7770-SubstituteChoices-repeat.ok ├── t7770-SubstituteChoices-repeat.vim ├── t7800-SubstituteIf-line.ok ├── t7800-SubstituteIf-line.vim ├── t7801-SubstituteUnless-line.ok ├── t7801-SubstituteUnless-line.vim ├── t7810-SubstituteIf-reference-match.ok ├── t7810-SubstituteIf-reference-match.vim ├── t7820-SubstituteIf-replacement-expr.ok ├── t7820-SubstituteIf-replacement-expr.vim ├── t7830-SubstituteIf-bad-predicate.ok ├── t7830-SubstituteIf-bad-predicate.vim ├── t7840-SubstituteIf-missing-predicate.vim ├── t7850-SubstituteIf-val.ok ├── t7850-SubstituteIf-val.vim ├── t7851-SubstituteIf-val.ok ├── t7851-SubstituteIf-val.vim ├── t7852-SubstituteIf-val.ok ├── t7852-SubstituteIf-val.vim ├── t7870-SubstituteIf-repeat.ok ├── t7870-SubstituteIf-repeat.vim ├── t7871-SubstituteUnless-repeat.ok ├── t7871-SubstituteUnless-repeat.vim ├── t7872-SubstituteUnless-repeat-opposite.ok ├── t7872-SubstituteUnless-repeat-opposite.vim ├── t7880-SubstituteIf-repeat-predicate.ok ├── t7880-SubstituteIf-repeat-predicate.vim ├── t7890-SubstituteIf-cursor-position.vim ├── t7891-SubstituteIf-cursor-no-change.vim ├── t7900-SubstituteExecute-line.ok ├── t7900-SubstituteExecute-line.vim ├── t7910-SubstituteExecute-buffer.ok ├── t7910-SubstituteExecute-buffer.vim ├── t7930-SubstituteExecute-bad-expression.ok ├── t7930-SubstituteExecute-bad-expression.vim ├── t7931-SubstituteExecute-throw-expression.ok ├── t7931-SubstituteExecute-throw-expression.vim ├── t7940-SubstituteExecute-missing-expression.vim ├── t7950-SubstituteExecute-val.ok ├── t7950-SubstituteExecute-val.vim ├── t7951-SubstituteExecute-val.ok ├── t7951-SubstituteExecute-val.vim ├── t7952-SubstituteExecute-val.ok ├── t7952-SubstituteExecute-val.vim ├── t7953-SubstituteExecute-val.ok ├── t7953-SubstituteExecute-val.vim ├── t7954-SubstituteExecute-val.ok ├── t7954-SubstituteExecute-val.vim ├── t7970-SubstituteExecute-repeat.ok ├── t7970-SubstituteExecute-repeat.vim ├── t7980-SubstituteExecute-repeat-expression.ok ├── t7980-SubstituteExecute-repeat-expression.vim ├── t7985-SubstituteExecute-repeat-flags.ok ├── t7985-SubstituteExecute-repeat-flags.vim ├── t7990-SubstituteExecute-cursor-position.vim ├── t7991-SubstituteExecute-cursor-no-change.ok ├── t7991-SubstituteExecute-cursor-no-change.vim ├── t8000-DeleteRanges.msgok ├── t8000-DeleteRanges.ok ├── t8000-DeleteRanges.vim ├── t8010-DeleteRanges-register.ok ├── t8010-DeleteRanges-register.vim ├── t8015-DeleteRanges-bar.vim ├── t8020-DeleteRanges-no-matching-ranges.vim ├── t8030-DeleteRanges-numeric.ok ├── t8030-DeleteRanges-numeric.vim ├── t8035-DeleteRanges-marks.ok ├── t8035-DeleteRanges-marks.vim ├── t8050-DeleteRanges-inverted.msgok ├── t8050-DeleteRanges-inverted.ok ├── t8050-DeleteRanges-inverted.vim ├── t8060-DeleteRanges-multiple.ok ├── t8060-DeleteRanges-multiple.vim ├── t8070-DeleteRanges-fold.ok ├── t8070-DeleteRanges-fold.vim ├── t8110-YankRanges-register.vim ├── t8150-YankRanges-inverted.vim ├── t8160-YankRanges-multiple.vim ├── t8200-PrintRanges.msgok ├── t8200-PrintRanges.vim ├── t8230-PrintRanges-jumplist.vim ├── t8250-PrintRanges-inverted.msgok ├── t8250-PrintRanges-inverted.vim ├── t8260-PrintRanges-multiple.msgok ├── t8260-PrintRanges-multiple.vim ├── t8270-PrintRanges-multiple-inverted.msgok ├── t8270-PrintRanges-multiple-inverted.vim ├── t8300-RangeDo.ok ├── t8300-RangeDo.vim ├── t8310-RangeDo-error.ok ├── t8310-RangeDo-error.vim ├── t8315-RangeDo-bar.ok ├── t8315-RangeDo-bar.vim ├── t8320-RangeDo-no-matching-ranges.vim ├── t8330-RangeDo-numeric.ok ├── t8330-RangeDo-numeric.vim ├── t8335-RangeDo-marks.ok ├── t8335-RangeDo-marks.vim ├── t8350-RangeDo-inverted.ok ├── t8350-RangeDo-inverted.vim ├── t8360-RangeDo-multiple.ok ├── t8360-RangeDo-multiple.vim ├── t8370-RangeDo-multiple-inverted.ok ├── t8370-RangeDo-multiple-inverted.vim ├── t8380-RangeDo-additions.ok ├── t8380-RangeDo-additions.vim ├── t8390-RangeDo-deletions.ok ├── t8390-RangeDo-deletions.vim ├── t8400-Renumber.ok ├── t8400-Renumber.vim ├── t8405-Renumber-default-range.ok ├── t8405-Renumber-default-range.vim ├── t8410-Renumber-start.ok ├── t8410-Renumber-start.vim ├── t8420-Renumber-start-offset.ok ├── t8420-Renumber-start-offset.vim ├── t8430-Renumber-pattern.ok ├── t8430-Renumber-pattern.vim ├── t8435-Renumber-empty-pat-fmt.ok ├── t8435-Renumber-empty-pat-fmt.vim ├── t8440-Renumber-fmt.ok ├── t8440-Renumber-fmt.vim ├── t8450-Renumber-floats.ok ├── t8450-Renumber-floats.vim ├── t8460-Renumber-offset-multiply.ok ├── t8460-Renumber-offset-multiply.vim ├── t8470-Renumber-errors.ok ├── t8470-Renumber-errors.vim ├── t8480-Renumber-priming.ok ├── t8480-Renumber-priming.vim ├── t8481-Renumber-only-priming.ok ├── t8481-Renumber-only-priming.vim ├── t9000-SubstituteSubsequent-line.ok ├── t9000-SubstituteSubsequent-line.vim ├── t9010-SubstituteSubsequent-buffer.ok ├── t9010-SubstituteSubsequent-buffer.vim ├── t9015-SubstituteSubsequent-bar.vim ├── t9020-SubstituteSubsequent-selected.ok ├── t9020-SubstituteSubsequent-selected.vim ├── t9025-SubstituteSubsequent-previous-search.ok ├── t9025-SubstituteSubsequent-previous-search.vim ├── t9030-SubstituteSubsequent-bad-answers.vim ├── t9040-SubstituteSubsequent-no-matches.vim ├── t9050-SubstituteSubsequent-pattern-start-line.ok ├── t9050-SubstituteSubsequent-pattern-start-line.vim ├── t9060-SubstituteSubsequent-blockwise-flag.ok ├── t9060-SubstituteSubsequent-blockwise-flag.vim ├── t9070-SubstituteSubsequent-fold.ok ├── t9070-SubstituteSubsequent-fold.vim ├── t9070-SubstituteSubsequent-repeat.ok ├── t9070-SubstituteSubsequent-repeat.vim ├── t9080-SubstituteSubsequent-repeat-answers.ok ├── t9080-SubstituteSubsequent-repeat-answers.vim ├── t9100-SubstituteTranslate-line.ok ├── t9100-SubstituteTranslate-line.vim ├── t9101-SubstituteTranslate-line-persist.ok ├── t9101-SubstituteTranslate-line-persist.vim ├── t9102-SubstituteTranslate-line-persist-i.ok ├── t9102-SubstituteTranslate-line-persist-i.vim ├── t9105-SubstituteTranslate-escaped-item.ok ├── t9105-SubstituteTranslate-escaped-item.vim ├── t9110-SubstituteTranslate-buffer-not-enough.ok ├── t9110-SubstituteTranslate-buffer-not-enough.vim ├── t9111-SubstituteTranslate-buffer-persist.ok ├── t9111-SubstituteTranslate-buffer-persist.vim ├── t9115-SubstituteTranslate-empty-match.ok ├── t9115-SubstituteTranslate-empty-match.vim ├── t9120-SubstituteTranslate-expression.ok ├── t9120-SubstituteTranslate-expression.vim ├── t9125-SubstituteTranslate-expression.ok ├── t9125-SubstituteTranslate-expression.vim ├── t9130-SubstituteTranslate-bad-expression.ok ├── t9130-SubstituteTranslate-bad-expression.vim ├── t9140-SubstituteTranslate-missing-expression.ok ├── t9140-SubstituteTranslate-missing-expression.vim ├── t9150-SubstituteTranslate-val.ok ├── t9150-SubstituteTranslate-val.vim ├── t9151-SubstituteTranslate-val.ok ├── t9151-SubstituteTranslate-val.vim ├── t9152-SubstituteTranslate-val.ok ├── t9152-SubstituteTranslate-val.vim ├── t9155-SubstituteTranslate-api-val.ok ├── t9155-SubstituteTranslate-api-val.vim ├── t9160-SubstituteTranslate-funcref.ok ├── t9160-SubstituteTranslate-funcref.vim ├── t9161-SubstituteTranslate-funcref-throw.ok ├── t9161-SubstituteTranslate-funcref-throw.vim ├── t9165-SubstituteTranslate-api-funcref.ok ├── t9165-SubstituteTranslate-api-funcref.vim ├── t9170-SubstituteTranslate-skip.ok ├── t9170-SubstituteTranslate-skip.vim ├── t9180-SubstituteTranslate-repeat.ok ├── t9180-SubstituteTranslate-repeat.vim ├── t9185-SubstituteTranslate-repeat-flags.ok ├── t9185-SubstituteTranslate-repeat-flags.vim ├── t9190-SubstituteTranslate-reset.ok ├── t9190-SubstituteTranslate-reset.vim ├── t9195-SubstituteTranslate-reset-items.ok ├── t9195-SubstituteTranslate-reset-items.vim ├── t9200-PutTranslations.ok ├── t9200-PutTranslations.vim ├── t9205-PutTranslations-line0.ok ├── t9205-PutTranslations-line0.vim ├── t9206-PutTranslations-current-line.ok ├── t9206-PutTranslations-current-line.vim ├── t9210-PutTranslations-custom-template.ok ├── t9210-PutTranslations-custom-template.vim ├── t9220-PutTranslations-invalid-template.vim ├── t9230-PutTranslations-none-yet.vim ├── t9250-YankTranslations.ok ├── t9250-YankTranslations.vim ├── t9260-YankTranslations-register.vim ├── t9270-YankTranslations-default-escaping.vim ├── t9300-SubstituteTransactional-argument-parsing.vim ├── t9310-SubstituteTransactional-line.ok ├── t9310-SubstituteTransactional-line.vim ├── t9315-SubstituteTransactional-zero-width.ok ├── t9315-SubstituteTransactional-zero-width.vim ├── t9317-SubstituteTransactional-lastLnum.ok ├── t9317-SubstituteTransactional-lastLnum.vim ├── t9320-SubstituteTransactional-context.ok ├── t9320-SubstituteTransactional-context.vim ├── t9325-SubstituteTransactional-expr-position.ok ├── t9325-SubstituteTransactional-expr-position.vim ├── t9327-SubstituteTransactional-expr-matches.ok ├── t9327-SubstituteTransactional-expr-matches.vim ├── t9328-SubstituteTransactional-expr-arbitrary-matches.ok ├── t9328-SubstituteTransactional-expr-arbitrary-matches.vim ├── t9330-SubstituteTransactional-test-expr-skip.ok ├── t9330-SubstituteTransactional-test-expr-skip.vim ├── t9335-SubstituteTransactional-test-expr-capture.ok ├── t9335-SubstituteTransactional-test-expr-capture.vim ├── t9340-SubstituteTransactional-update-predicate.ok ├── t9340-SubstituteTransactional-update-predicate.vim ├── t9345-SubstituteTransactional-test-update-predicate.ok ├── t9345-SubstituteTransactional-test-update-predicate.vim ├── t9350-SubstituteTransactional-repeat.ok ├── t9350-SubstituteTransactional-repeat.vim ├── t9355-SubstituteTransactional-repeat-flags.ok ├── t9355-SubstituteTransactional-repeat-flags.vim ├── t9360-SubstituteTransactional-api.ok ├── t9360-SubstituteTransactional-api.vim ├── t9400-SubstituteTransactionalExpr-buffer.ok ├── t9400-SubstituteTransactionalExpr-buffer.vim ├── t9402-SubstituteTransactionalExpr-string-split.ok ├── t9402-SubstituteTransactionalExpr-string-split.vim ├── t9410-SubstituteTransactionalExpr-no-matches.ok ├── t9410-SubstituteTransactionalExpr-no-matches.vim ├── t9412-SubstituteTransactionalExpr-no-patterns.vim ├── t9414-SubstituteTransactionalExpr-capture-group.vim ├── t9416-SubstituteTransactionalExpr-magic.ok ├── t9416-SubstituteTransactionalExpr-magic.vim ├── t9420-SubstituteTransactionalExpr-less-replacements.ok ├── t9420-SubstituteTransactionalExpr-less-replacements.vim ├── t9430-SubstituteTransactionalExpr-context.ok ├── t9430-SubstituteTransactionalExpr-context.vim ├── t9440-SubstituteTransactionalExpr-test-expr-skip.ok ├── t9440-SubstituteTransactionalExpr-test-expr-skip.vim ├── t9445-SubstituteTransactionalExpr-test-expr-patternIndex.ok ├── t9445-SubstituteTransactionalExpr-test-expr-patternIndex.vim ├── t9450-SubstituteTransactionalExpr-expr-patternIndex.ok ├── t9450-SubstituteTransactionalExpr-expr-patternIndex.vim ├── t9460-SubstituteTransactionalExpr-test-expr-capture.ok ├── t9460-SubstituteTransactionalExpr-test-expr-capture.vim ├── t9470-SubstituteTransactionalExpr-update-predicate.ok ├── t9470-SubstituteTransactionalExpr-update-predicate.vim ├── t9475-SubstituteTransactionalExpr-test-update-predicate.ok ├── t9475-SubstituteTransactionalExpr-test-update-predicate.vim ├── t9480-SubstituteTransactionalExpr-repeat.ok ├── t9480-SubstituteTransactionalExpr-repeat.vim ├── t9485-SubstituteTransactionalExpr-repeat-flags.ok ├── t9485-SubstituteTransactionalExpr-repeat-flags.vim ├── t9490-SubstituteTransactionalExpr-api.ok ├── t9490-SubstituteTransactionalExpr-api.vim ├── t9500-SubstituteTransactionalExprEach-buffer.ok ├── t9500-SubstituteTransactionalExprEach-buffer.vim ├── t9502-SubstituteTransactionalExprEach-string-split.ok ├── t9502-SubstituteTransactionalExprEach-string-split.vim ├── t9510-SubstituteTransactionalExprEach-no-matches.ok ├── t9510-SubstituteTransactionalExprEach-no-matches.vim ├── t9512-SubstituteTransactionalExprEach-no-patterns.vim ├── t9514-SubstituteTransactionalExprEach-capture-group.ok ├── t9514-SubstituteTransactionalExprEach-capture-group.vim ├── t9516-SubstituteTransactionalExprEach-magic.ok ├── t9516-SubstituteTransactionalExprEach-magic.vim ├── t9520-SubstituteTransactionalExprEach-less-replacements.ok ├── t9520-SubstituteTransactionalExprEach-less-replacements.vim ├── t9530-SubstituteTransactionalExprEach-context.ok ├── t9530-SubstituteTransactionalExprEach-context.vim ├── t9540-SubstituteTransactionalExprEach-test-expr-skip.ok ├── t9540-SubstituteTransactionalExprEach-test-expr-skip.vim ├── t9545-SubstituteTransactionalExprEach-test-expr-patternIndex.ok ├── t9545-SubstituteTransactionalExprEach-test-expr-patternIndex.vim ├── t9550-SubstituteTransactionalExprEach-expr-patternIndex.ok ├── t9550-SubstituteTransactionalExprEach-expr-patternIndex.vim ├── t9552-SubstituteTransactionalExprEach-expr-patternIndex.ok ├── t9552-SubstituteTransactionalExprEach-expr-patternIndex.vim ├── t9554-SubstituteTransactionalExprEach-expr-patternIndex.ok ├── t9554-SubstituteTransactionalExprEach-expr-patternIndex.vim ├── t9555-SubstituteTransactionalExprEach-multiple-replacements.ok ├── t9555-SubstituteTransactionalExprEach-multiple-replacements.vim ├── t9560-SubstituteTransactionalExprEach-test-expr-capture.ok ├── t9560-SubstituteTransactionalExprEach-test-expr-capture.vim ├── t9570-SubstituteTransactionalExprEach-update-predicate.ok ├── t9570-SubstituteTransactionalExprEach-update-predicate.vim ├── t9575-SubstituteTransactionalExprEach-test-update-predicate.ok ├── t9575-SubstituteTransactionalExprEach-test-update-predicate.vim ├── t9580-SubstituteTransactionalExprEach-repeat.ok ├── t9580-SubstituteTransactionalExprEach-repeat.vim ├── t9585-SubstituteTransactionalExprEach-repeat-flags.ok ├── t9585-SubstituteTransactionalExprEach-repeat-flags.vim ├── t9590-SubstituteTransactionalExprEach-api.ok ├── t9590-SubstituteTransactionalExprEach-api.vim ├── t9595-SubstituteTransactionalExprEach-SortByPosition.vim ├── t9600-SubstituteRotate.ok ├── t9600-SubstituteRotate.vim ├── t9610-SubstituteRotate-no-matches.ok ├── t9610-SubstituteRotate-no-matches.vim ├── t9620-SubstituteRotate-no-offset.vim ├── t9630-SubstituteRotate-shift.ok ├── t9630-SubstituteRotate-shift.vim ├── t9635-SubstituteRotate-shift-expr.ok ├── t9635-SubstituteRotate-shift-expr.vim ├── t9650-SubstituteRotate-repeat.ok ├── t9650-SubstituteRotate-repeat.vim ├── t9660-SubstituteRotate-shift-repeat.ok ├── t9660-SubstituteRotate-shift-repeat.vim ├── t9670-SubstituteRotate-test-expr-skip.ok ├── t9670-SubstituteRotate-test-expr-skip.vim ├── t9680-SubstituteRotate-update-predicate.ok ├── t9680-SubstituteRotate-update-predicate.vim ├── t9690-SubstituteRotateMemoized.ok ├── t9690-SubstituteRotateMemoized.vim ├── t9691-SubstituteRotateMemoized-shift.ok ├── t9691-SubstituteRotateMemoized-shift.vim ├── t9692-SubstituteRotateMemoized-shift-unpersisted.ok ├── t9692-SubstituteRotateMemoized-shift-unpersisted.vim ├── t9693-SubstituteRotateMemoized-shift-scrambled.ok ├── t9693-SubstituteRotateMemoized-shift-scrambled.vim ├── t9694-SubstituteRotateMemoized-shift-scrambled.ok ├── t9694-SubstituteRotateMemoized-shift-scrambled.vim ├── t9695-SubstituteRotateMemoized-persist.ok ├── t9695-SubstituteRotateMemoized-persist.vim ├── t9696-SubstituteRotateMemoized-shift-persist.ok ├── t9696-SubstituteRotateMemoized-shift-persist.vim ├── t9697-SubstituteRotateMemoized-mixed-persist.ok ├── t9697-SubstituteRotateMemoized-mixed-persist.vim └── text.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.msgout 2 | *.msgresult 3 | *.out 4 | *.tap 5 | doc/*.description 6 | doc/*.install 7 | tags 8 | -------------------------------------------------------------------------------- /tests/_setup.vim: -------------------------------------------------------------------------------- 1 | call vimtest#AddDependency('vim-ingo-library') 2 | 3 | runtime plugin/PatternsOnText.vim 4 | -------------------------------------------------------------------------------- /tests/duplicateAndEmptyLines.txt: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | 5 | baz 6 | spaz 7 | spaz 8 | 9 | 10 | fooxy 11 | --- 12 | bar 13 | foox 14 | Boo 15 | bar 16 | Boo 17 | 18 | 19 | eof 20 | -------------------------------------------------------------------------------- /tests/duplicateLines.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | spaz 6 | fooxy 7 | bar 8 | foox 9 | Boo 10 | bar 11 | Boo 12 | eof 13 | -------------------------------------------------------------------------------- /tests/duplicates.txt: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in hih a bar for the bartender. 8 | E foox 9 | E my bar is not my foo! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/ranges.txt: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | ha 7 | } 8 | intermediate 9 | { 10 | hi 11 | he 12 | ho 13 | } 14 | { 15 | } 16 | end 17 | middle 18 | begin 19 | foo 20 | zzz 21 | bar 22 | end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t1000-PrintDuplicateLinesOf.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 2 bar 3 | 7 bar 4 | 10 bar 5 | end 6 | -------------------------------------------------------------------------------- /tests/t1000-PrintDuplicateLinesOf.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates of the current line found in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(2) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | echomsg 'start' 9 | PrintDuplicateLinesOf 10 | echomsg 'end' 11 | call vimtap#Is(getpos('.'), [0, 10, 1, 0], 'cursor at last duplicate line') 12 | call vimtap#Ok(! &l:modified, 'buffer not modified') 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t1010-PrintDuplicateLinesOf-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no duplicates of the current line found. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 1 8 | call vimtap#err#Errors('No duplicate lines', 'PrintDuplicateLinesOf', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t1020-PrintDuplicateLinesOf-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | bar 3 | 2 bar 4 | 7 bar 5 | 10 bar 6 | Boo 7 | 9 Boo 8 | 11 Boo 9 | end 10 | -------------------------------------------------------------------------------- /tests/t1020-PrintDuplicateLinesOf-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates of passed pattern found in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintDuplicateLinesOf ^\cb..$ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t1040-PrintDuplicateLinesOf-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 7 bar 3 | 10 bar 4 | end 5 | -------------------------------------------------------------------------------- /tests/t1050-PrintDuplicateLinesOf-empty-lines.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 6 spaz 3 | 7 spaz 4 | end 5 | 6 | start 7 | bar 8 | 12 bar 9 | 15 bar 10 | Boo 11 | 14 Boo 12 | 16 Boo 13 | 14 | 17 15 | 18 16 | end 17 | -------------------------------------------------------------------------------- /tests/t1050-PrintDuplicateLinesOf-empty-lines.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates including empty lines. 2 | 3 | edit duplicateAndEmptyLines.txt 4 | 1 5 | echomsg 'start' 6 | 1,10PrintDuplicateLinesOf ^spaz$ 7 | echomsg 'end' 8 | echomsg 'start' 9 | 12,$PrintDuplicateLinesOf ^\%(\cb..\)\?$ 10 | echomsg 'end' 11 | 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t1080-PrintDuplicateLinesOf-inverted.msgok: -------------------------------------------------------------------------------- 1 | start 2 | spaz 3 | 4 spaz 4 | 5 spaz 5 | Boo 6 | 9 Boo 7 | 11 Boo 8 | end 9 | -------------------------------------------------------------------------------- /tests/t1090-PrintDuplicateLinesOf-inverted-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 4 spaz 3 | 5 spaz 4 | end 5 | -------------------------------------------------------------------------------- /tests/t1090-PrintDuplicateLinesOf-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates of not passed pattern found in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintDuplicateLinesOf! ^\cb..$ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t1100-DeleteDuplicateLinesOf.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | spaz 6 | fooxy 7 | foox 8 | Boo 9 | Boo 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t1100-DeleteDuplicateLinesOf.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates of the current line found in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteDuplicateLinesOf 9 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t1110-DeleteDuplicateLinesOf-error-unmodifiable.vim: -------------------------------------------------------------------------------- 1 | " Test error message when buffer is not modifiable. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | setlocal nomodifiable 8 | 2 9 | call vimtap#err#ErrorsLike('^E21:', 'DeleteDuplicateLinesOf', 'error shown') 10 | 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t1150-DeleteDuplicateLinesOf-empty-lines.ok: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | 5 | baz 6 | spaz 7 | 8 | 9 | fooxy 10 | --- 11 | bar 12 | foox 13 | Boo 14 | 15 | eof 16 | -------------------------------------------------------------------------------- /tests/t1150-DeleteDuplicateLinesOf-empty-lines.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates including empty lines. 2 | 3 | edit duplicateAndEmptyLines.txt 4 | 12,$DeleteDuplicateLinesOf ^\%(\cb..\)\?$ 5 | 1,10DeleteDuplicateLinesOf ^spaz$ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t1170-DeleteDuplicateLinesOf-fold.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | spaz 6 | fooxy 7 | bar 8 | foox 9 | Boo 10 | Boo 11 | eof 12 | -------------------------------------------------------------------------------- /tests/t1170-DeleteDuplicateLinesOf-fold.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates of the current line found in the fold. 2 | 3 | edit duplicateLines.txt 4 | 7,11fold 5 | 2 6 | 7DeleteDuplicateLinesOf 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t1190-DeleteDuplicateLinesOf-inverted.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | fooxy 6 | bar 7 | foox 8 | Boo 9 | bar 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t1190-DeleteDuplicateLinesOf-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates of not the current line found in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteDuplicateLinesOf! 9 | call vimtap#Is(getpos('.'), [0, 10, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t1510-PrintUniqueLinesOf-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no unique of the pattern found. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(2) 5 | 6 | edit duplicateLines.txt 7 | call vimtap#err#ErrorsLike('^E471:.*PrintUniqueLinesOf', 'PrintUniqueLinesOf', 'argument error shown') 8 | call vimtap#err#Errors('No unique lines', 'PrintUniqueLinesOf bar', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t1520-PrintUniqueLinesOf-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 1 foo 3 | 3 baz 4 | 12 eof 5 | end 6 | -------------------------------------------------------------------------------- /tests/t1520-PrintUniqueLinesOf-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques of passed pattern found in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintUniqueLinesOf ^...$ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t1540-PrintUniqueLinesOf-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 6 fooxy 3 | 8 foox 4 | end 5 | -------------------------------------------------------------------------------- /tests/t1540-PrintUniqueLinesOf-range.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques found in the passed range. 2 | " Tests that the current line, not the start of the range is used. 3 | 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | edit duplicateLines.txt 8 | 2 9 | echomsg 'start' 10 | 4,$-1PrintUniqueLinesOf .* 11 | echomsg 'end' 12 | call vimtap#Is(getpos('.'), [0, 8, 1, 0], 'cursor at last unique line') 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t1590-PrintUniqueLinesOf-inverted-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 6 fooxy 3 | 8 foox 4 | end 5 | -------------------------------------------------------------------------------- /tests/t1590-PrintUniqueLinesOf-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques of not passed pattern found in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintUniqueLinesOf! ^...$ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t1615-DeleteUniqueLinesOf-bar.ok: -------------------------------------------------------------------------------- 1 | bar 2 | spaz 3 | spaz 4 | fooxy 5 | bar 6 | foox 7 | Boo 8 | bar 9 | Boo 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t2000-PrintDuplicateLinesIgnoring.msgok: -------------------------------------------------------------------------------- 1 | start 2 | bar 3 | 2 bar 4 | 7 bar 5 | 10 bar 6 | spaz 7 | 4 spaz 8 | 5 spaz 9 | Boo 10 | 9 Boo 11 | 11 Boo 12 | end 13 | -------------------------------------------------------------------------------- /tests/t2000-PrintDuplicateLinesIgnoring.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicate lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(2) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | echomsg 'start' 9 | PrintDuplicateLinesIgnoring 10 | echomsg 'end' 11 | call vimtap#Is(getpos('.'), [0, 11, 1, 0], 'cursor at last duplicate line') 12 | call vimtap#Ok(! &l:modified, 'buffer not modified') 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t2010-PrintDuplicateLinesIgnoring-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no duplicate lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | call setline(1, 'foo') 7 | call setline(2, 'bar') 8 | 1 9 | call vimtap#err#Errors('No duplicate lines', 'PrintDuplicateLinesIgnoring', 'error shown') 10 | 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t2020-PrintDuplicateLinesIgnoring-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 4 spaz 3 | 5 spaz 4 | end 5 | -------------------------------------------------------------------------------- /tests/t2020-PrintDuplicateLinesIgnoring-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicate lines without passed pattern in the entire buffer. 2 | " Tests that the line isn't printed again as a header when there's only one particular line with duplicates. 3 | 4 | edit duplicateLines.txt 5 | 1 6 | echomsg 'start' 7 | PrintDuplicateLinesIgnoring ^\cb..$ 8 | echomsg 'end' 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t2040-PrintDuplicateLinesIgnoring-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | bar 3 | 7 bar 4 | 10 bar 5 | Boo 6 | 9 Boo 7 | 11 Boo 8 | end 9 | -------------------------------------------------------------------------------- /tests/t2040-PrintDuplicateLinesIgnoring-range.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicate lines in the passed range. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | echomsg 'start' 9 | 5,$PrintDuplicateLinesIgnoring 10 | echomsg 'end' 11 | call vimtap#Is(getpos('.'), [0, 11, 1, 0], 'cursor at last duplicate line') 12 | 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t2050-PrintDuplicateLinesIgnoring-empty-lines.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 3 | 2 4 | 4 5 | 8 6 | 9 7 | spaz 8 | 6 spaz 9 | 7 spaz 10 | end 11 | 12 | start 13 | bar 14 | 12 bar 15 | 15 bar 16 | Boo 17 | 14 Boo 18 | 16 Boo 19 | end 20 | -------------------------------------------------------------------------------- /tests/t2050-PrintDuplicateLinesIgnoring-empty-lines.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicate lines including empty lines. 2 | 3 | edit duplicateAndEmptyLines.txt 4 | 1 5 | echomsg 'start' 6 | 1,10PrintDuplicateLinesIgnoring ^\cb..$ 7 | echomsg 'end' 8 | echomsg 'start' 9 | 12,$PrintDuplicateLinesIgnoring ^$ 10 | echomsg 'end' 11 | 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t2080-PrintDuplicateLinesIgnoring-inverted.msgok: -------------------------------------------------------------------------------- 1 | start 2 | bar 3 | 2 bar 4 | 7 bar 5 | 10 bar 6 | spaz 7 | 4 spaz 8 | 5 spaz 9 | Boo 10 | 9 Boo 11 | 11 Boo 12 | end 13 | -------------------------------------------------------------------------------- /tests/t2090-PrintDuplicateLinesIgnoring-inverted-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | bar 3 | 2 bar 4 | 7 bar 5 | 10 bar 6 | Boo 7 | 9 Boo 8 | 11 Boo 9 | end 10 | -------------------------------------------------------------------------------- /tests/t2090-PrintDuplicateLinesIgnoring-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicate lines without not passed pattern in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintDuplicateLinesIgnoring! ^\cb..$ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t2100-DeleteDuplicateLinesIgnoring.msgok: -------------------------------------------------------------------------------- 1 | 4 fewer lines 2 | -------------------------------------------------------------------------------- /tests/t2100-DeleteDuplicateLinesIgnoring.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | fooxy 6 | foox 7 | Boo 8 | eof 9 | -------------------------------------------------------------------------------- /tests/t2100-DeleteDuplicateLinesIgnoring.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicate lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteDuplicateLinesIgnoring 9 | call vimtap#Is(getpos('.'), [0, 8, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t2150-DeleteDuplicateLinesIgnoring-empty-lines.ok: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | baz 5 | spaz 6 | fooxy 7 | --- 8 | bar 9 | foox 10 | Boo 11 | 12 | 13 | eof 14 | -------------------------------------------------------------------------------- /tests/t2150-DeleteDuplicateLinesIgnoring-empty-lines.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicate lines including empty lines. 2 | 3 | edit duplicateAndEmptyLines.txt 4 | 12,$DeleteDuplicateLinesIgnoring ^$ 5 | 1,10DeleteDuplicateLinesIgnoring ^\cb..$ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t2190-DeleteDuplicateLinesIgnoring-inverted-pattern.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | spaz 5 | spaz 6 | fooxy 7 | foox 8 | Boo 9 | eof 10 | -------------------------------------------------------------------------------- /tests/t2190-DeleteDuplicateLinesIgnoring-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicate lines without not passed pattern in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteDuplicateLinesIgnoring! ^\cb..$ 9 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t2200-DeleteAllDuplicateLinesIgnoring.ok: -------------------------------------------------------------------------------- 1 | foo 2 | baz 3 | fooxy 4 | foox 5 | eof 6 | -------------------------------------------------------------------------------- /tests/t2200-DeleteAllDuplicateLinesIgnoring.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteAllDuplicateLinesIgnoring 9 | call vimtap#Is(getpos('.'), [0, 5, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t2220-DeleteAllDuplicateLinesIgnoring-pattern.ok: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | baz 4 | fooxy 5 | bar 6 | foox 7 | Boo 8 | bar 9 | Boo 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t2220-DeleteAllDuplicateLinesIgnoring-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines without passed pattern in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | DeleteAllDuplicateLinesIgnoring ^\cb..$ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t2250-DeleteAllDuplicateLinesIgnoring-empty-lines.ok: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | 5 | baz 6 | 7 | 8 | fooxy 9 | --- 10 | foox 11 | eof 12 | -------------------------------------------------------------------------------- /tests/t2250-DeleteAllDuplicateLinesIgnoring-empty-lines.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines including empty lines. 2 | 3 | edit duplicateAndEmptyLines.txt 4 | 12,$DeleteAllDuplicateLinesIgnoring 5 | 1,10DeleteAllDuplicateLinesIgnoring ^$ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t2270-DeleteAllDuplicateLinesIgnoring-fold.ok: -------------------------------------------------------------------------------- 1 | foo 2 | baz 3 | fooxy 4 | foox 5 | eof 6 | -------------------------------------------------------------------------------- /tests/t2270-DeleteAllDuplicateLinesIgnoring-fold.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines in the folded buffer. 2 | " Tests that only the duplicate lines itself are deleted, not the entire folds 3 | " containing them. 4 | 5 | edit duplicateLines.txt 6 | 4,5fold 7 | 6,7fold 8 | 8,9fold 9 | 2 10 | DeleteAllDuplicateLinesIgnoring 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t2280-DeleteAllDuplicateLinesIgnoring-inverted.ok: -------------------------------------------------------------------------------- 1 | foo 2 | baz 3 | fooxy 4 | foox 5 | eof 6 | -------------------------------------------------------------------------------- /tests/t2280-DeleteAllDuplicateLinesIgnoring-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines in the entire buffer. 2 | " Tests that [!] is without effect when there's no /{pattern}/ 3 | 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | edit duplicateLines.txt 8 | 2 9 | DeleteAllDuplicateLinesIgnoring! 10 | call vimtap#Is(getpos('.'), [0, 5, 1, 0], 'cursor after last deleted line') 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t2290-DeleteAllDuplicateLinesIgnoring-inverted-pattern.ok: -------------------------------------------------------------------------------- 1 | foo 2 | baz 3 | spaz 4 | spaz 5 | fooxy 6 | foox 7 | eof 8 | -------------------------------------------------------------------------------- /tests/t2290-DeleteAllDuplicateLinesIgnoring-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicate lines without not passed pattern in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | DeleteAllDuplicateLinesIgnoring! ^\cb..$ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t2500-PrintUniqueLinesIgnoring.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 1 foo 3 | 3 baz 4 | 6 fooxy 5 | 8 foox 6 | 12 eof 7 | end 8 | -------------------------------------------------------------------------------- /tests/t2500-PrintUniqueLinesIgnoring.vim: -------------------------------------------------------------------------------- 1 | " Test printing unique lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | echomsg 'start' 9 | PrintUniqueLinesIgnoring 10 | echomsg 'end' 11 | call vimtap#Is(getpos('.'), [0, 12, 1, 0], 'cursor at last unique line') 12 | 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t2510-PrintUniqueLinesIgnoring-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no unique lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | call setline(1, 'foo') 7 | call setline(2, 'foo') 8 | 1 9 | call vimtap#err#Errors('No unique lines', 'PrintUniqueLinesIgnoring', 'error shown') 10 | 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t2520-PrintUniqueLinesIgnoring-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 1 foo 3 | 3 baz 4 | 6 fooxy 5 | 8 foox 6 | end 7 | -------------------------------------------------------------------------------- /tests/t2520-PrintUniqueLinesIgnoring-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing unique lines without passed pattern in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintUniqueLinesIgnoring eof 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t2540-PrintUniqueLinesIgnoring-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 5 spaz 3 | 6 fooxy 4 | 8 foox 5 | end 6 | -------------------------------------------------------------------------------- /tests/t2540-PrintUniqueLinesIgnoring-range.vim: -------------------------------------------------------------------------------- 1 | " Test printing unique lines in the passed range. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | echomsg 'start' 9 | 5,$-1PrintUniqueLinesIgnoring 10 | echomsg 'end' 11 | call vimtap#Is(getpos('.'), [0, 8, 1, 0], 'cursor at last unique line') 12 | 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t2580-PrintUniqueLinesIgnoring-inverted.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 1 foo 3 | 3 baz 4 | 6 fooxy 5 | 8 foox 6 | 12 eof 7 | end 8 | -------------------------------------------------------------------------------- /tests/t2580-PrintUniqueLinesIgnoring-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test printing unique lines in the entire buffer. 2 | " Tests that [!] is without effect when there's no /{pattern}/ 3 | 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | edit duplicateLines.txt 8 | 2 9 | echomsg 'start' 10 | PrintUniqueLinesIgnoring! 11 | echomsg 'end' 12 | call vimtap#Is(getpos('.'), [0, 12, 1, 0], 'cursor at last unique line') 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t2590-PrintUniqueLinesIgnoring-inverted-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 1 foo 3 | 6 fooxy 4 | 8 foox 5 | end 6 | -------------------------------------------------------------------------------- /tests/t2590-PrintUniqueLinesIgnoring-inverted-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing unique lines without not passed pattern in the entire buffer. 2 | 3 | edit duplicateLines.txt 4 | 1 5 | echomsg 'start' 6 | PrintUniqueLinesIgnoring! /.*oo.*/ 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t2600-DeleteUniqueLinesIgnoring.vim: -------------------------------------------------------------------------------- 1 | " Test deleting unique lines in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicateLines.txt 7 | 2 8 | DeleteUniqueLinesIgnoring 9 | call vimtap#Is(getpos('.'), [0, 7, 1, 0], 'cursor after last deleted line') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3000-PrintDuplicates.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^7 .*/ 3 | 9 my: 2 4 | end 5 | -------------------------------------------------------------------------------- /tests/t3000-PrintDuplicates.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates in the current line. 2 | 3 | edit duplicates.txt 4 | echomsg 'start' 5 | 9PrintDuplicates \<\w\+\> 6 | echomsg 'end' 7 | 8 | call vimtest#StartTap() 9 | call vimtap#Plan(1) 10 | call vimtap#Ok(! &l:modified, 'buffer not modified') 11 | 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3010-PrintDuplicates-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^3 .*/ 3 | 6 foo: 3 in 6, 8, 9 4 | end 5 | -------------------------------------------------------------------------------- /tests/t3010-PrintDuplicates-range.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates in the passed range. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | echomsg 'start' 6 | 6,9PrintDuplicates foo 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t3020-PrintDuplicates-buffer.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^4 .*/ 3 | 1 foo: 4 in 1, 6, 8, 9 4 | end 5 | -------------------------------------------------------------------------------- /tests/t3020-PrintDuplicates-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates in the entire buffer. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | echomsg 'start' 6 | %PrintDuplicates foo 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t3030-PrintDuplicates-pattern.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^35 .*/ 3 | 1 E: 10 in 10 lines 4 | 1 foo: 2 in 1, 9 5 | 2 bar: 4 in 2, 7, 9 6 | 4 spaz: 2 in 4, 5 7 | 7 hih: 2 8 | 7 is: 2 in 7, 9 9 | 7 the: 2 10 | 9 my: 2 11 | end 12 | -------------------------------------------------------------------------------- /tests/t3030-PrintDuplicates-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates of a pattern in the entire buffer. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | echomsg 'start' 6 | %PrintDuplicates \<\w\+\> 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t3070-PrintDuplicates-fold.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^21 .*/ 3 | 7 E: 3 in 7, 8, 9 4 | 7 bar: 3 in 7, 9 5 | 7 hih: 2 6 | 7 is: 2 in 7, 9 7 | 7 the: 2 8 | 9 my: 2 9 | end 10 | -------------------------------------------------------------------------------- /tests/t3070-PrintDuplicates-fold.vim: -------------------------------------------------------------------------------- 1 | " Test printing duplicates in the current fold. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | 7,9fold 6 | echomsg 'start' 7 | 7PrintDuplicates \<\w\+\> 8 | echomsg 'end' 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t3130-DeleteDuplicates-pattern.msgok: -------------------------------------------------------------------------------- 1 | Deleted 17 matches of 8 duplicates in 9 lines 2 | -------------------------------------------------------------------------------- /tests/t3130-DeleteDuplicates-pattern.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | bar 3 | baz 4 | spaz 5 | 6 | fooxy 7 | the bar hih is in a for bartender. 8 | foox 9 | my not ! 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t3130-DeleteDuplicates-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | %DeleteDuplicates \<\w\+\>\s* 8 | call vimtap#Is(getpos('.'), [0, 10, 1, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3140-DeleteDuplicates-range.msgok: -------------------------------------------------------------------------------- 1 | Deleted 2 duplicate matches in 2 lines 2 | -------------------------------------------------------------------------------- /tests/t3140-DeleteDuplicates-range.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in hih a bar for the bartender. 8 | E x 9 | E my bar is not my ! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t3140-DeleteDuplicates-range.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates in the passed range. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | 3,$DeleteDuplicates foo 8 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3150-DeleteDuplicates.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in hih a bar for the bartender. 8 | E foox 9 | E my bar is not foo! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t3150-DeleteDuplicates.vim: -------------------------------------------------------------------------------- 1 | " Test deleting duplicates in the current line. 2 | 3 | set report=1 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | edit duplicates.txt 8 | 9DeleteDuplicates \<\w\+\> 9 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor on last line with deletions') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3500-PrintUniques.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^7 .*/ 3 | 9 E 4 | 9 bar 5 | 9 foo 6 | 9 is 7 | 9 not 8 | end 9 | -------------------------------------------------------------------------------- /tests/t3500-PrintUniques.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques in the current line. 2 | 3 | edit duplicates.txt 4 | echomsg 'start' 5 | 9PrintUniques \<\w\+\> 6 | echomsg 'end' 7 | 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t3510-PrintUniques-range.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^23 .*/ 3 | 6 fooxy 4 | 7 a 5 | 7 bartender 6 | 7 for 7 | 7 in 8 | 8 foox 9 | 9 foo 10 | 9 not 11 | end 12 | -------------------------------------------------------------------------------- /tests/t3510-PrintUniques-range.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques in the passed range. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | echomsg 'start' 6 | 6,9PrintUniques \<\w\+\> 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t3520-PrintUniques-buffer.msgok: -------------------------------------------------------------------------------- 1 | start 2 | /^19 .*/ 3 | 3 baz 4 | 6 fooxy 5 | 7 bartender 6 | 7 for 7 | 8 foox 8 | 9 not 9 | 10 eof 10 | end 11 | -------------------------------------------------------------------------------- /tests/t3520-PrintUniques-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test printing uniques in the entire buffer. 2 | 3 | set report=999 " Avoid the substitution command being printed in the captured log. 4 | edit duplicates.txt 5 | echomsg 'start' 6 | %PrintUniques \<\w\{3,}\> 7 | echomsg 'end' 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t3610-DeleteUniques-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no unique lines in the entire buffer. 2 | 3 | set report=1 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call setline(1, 'foo') 8 | call setline(2, 'foo') 9 | call vimtap#err#Errors('No unique matches', '%DeleteUniques \<\w\+\>', 'error shown') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3630-DeleteUniques-pattern.msgok: -------------------------------------------------------------------------------- 1 | Deleted 9 unique matches in 6 lines 2 | -------------------------------------------------------------------------------- /tests/t3630-DeleteUniques-pattern.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E 4 | E spaz 5 | E spaz 6 | E 7 | E the bar hih is hih bar the. 8 | E 9 | E my bar is my foo! 10 | E 11 | -------------------------------------------------------------------------------- /tests/t3630-DeleteUniques-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting uniques in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | %DeleteUniques\s*\<\w\+\> 8 | call vimtap#Is(getpos('.'), [0, 10, 1, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3640-DeleteUniques-range.msgok: -------------------------------------------------------------------------------- 1 | Deleted 7 unique matches in 5 lines 2 | -------------------------------------------------------------------------------- /tests/t3640-DeleteUniques-range.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E 4 | E spaz 5 | E spaz 6 | E 7 | E the bar hih is in hih a bar the. 8 | E 9 | E my bar is my! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t3640-DeleteUniques-range.vim: -------------------------------------------------------------------------------- 1 | " Test deleting uniques in the passed range. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | 3,$-1DeleteUniques\s*\<\w\{3,}\> 8 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3650-DeleteUniques.msgok: -------------------------------------------------------------------------------- 1 | Deleted 5 unique matches in 1 line 2 | -------------------------------------------------------------------------------- /tests/t3650-DeleteUniques.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in hih a bar for the bartender. 8 | E foox 9 | my my ! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t3650-DeleteUniques.vim: -------------------------------------------------------------------------------- 1 | " Test deleting uniques in the current line. 2 | 3 | set report=1 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | edit duplicates.txt 8 | 9DeleteUniques \<\w\+\> 9 | call vimtap#Is(getpos('.'), [0, 9, 2, 0], 'cursor on last line with deletions') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3710-DeleteAllDuplicates-error.vim: -------------------------------------------------------------------------------- 1 | " Test error message when no duplicate lines in the entire buffer. 2 | 3 | set report=1 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call setline(1, 'foo') 8 | call setline(2, 'bar') 9 | call vimtap#err#Errors('No duplicates', '%DeleteAllDuplicates \<\w\+\>', 'error shown') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t3730-DeleteAllDuplicates-pattern.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | baz 4 | 5 | 6 | fooxy 7 | in a for bartender. 8 | foox 9 | not! 10 | eof 11 | -------------------------------------------------------------------------------- /tests/t3730-DeleteAllDuplicates-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicates in the entire buffer. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | %DeleteAllDuplicates\s*\<\w\+\> 8 | call vimtap#Is(getpos('.'), [0, 10, 2, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3740-DeleteAllDuplicates-range.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E 5 | E 6 | E fooxy 7 | E is in a for bartender. 8 | E foox 9 | E my is not my foo! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t3740-DeleteAllDuplicates-range.vim: -------------------------------------------------------------------------------- 1 | " Test deleting all duplicates in the passed range. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit duplicates.txt 7 | 3,$-1DeleteAllDuplicates\s*\<\w\{3,}\> 8 | call vimtap#Is(getpos('.'), [0, 9, 1, 0], 'cursor on last line with deletions') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t3750-DeleteAllDuplicates.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E is in a for bartender. 8 | E foox 9 | E bar is not foo! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t4000-SubstituteSelected-line.ok: -------------------------------------------------------------------------------- 1 | foo(1, XXX, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t4000-SubstituteSelected-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing the second of four instances in a single line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteSelected/foo/XXX/g nynn 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4010-SubstituteSelected-buffer.ok: -------------------------------------------------------------------------------- 1 | foo(1, XXX, "foobar", fox[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and XXX! 4 | -------------------------------------------------------------------------------- /tests/t4040-SubstituteSelected-replacements.ok: -------------------------------------------------------------------------------- 1 | {o:ffoo}(1, foo, "foobar", fox[1], bar) && {o:ffoo}(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo and foo! Foo and foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t4040-SubstituteSelected-replacements.vim: -------------------------------------------------------------------------------- 1 | " Test references in replacement. 2 | 3 | edit text.txt 4 | 1SubstituteSelected/\<\(.\)\(.\)\2\>/{\2:\1\0}/g yn 5 | 3SubstituteSelected/foo/& and &/gi yny 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4045-SubstituteSelected-replacements-escaping.ok: -------------------------------------------------------------------------------- 1 | \&\1{o:ffoo}\1&\(1, foo, "foobar", fox[1], bar) && \&\1{o:ffoo}\1&\(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more \foo and &\! Foo and \foo and &\! 4 | -------------------------------------------------------------------------------- /tests/t4045-SubstituteSelected-replacements-escaping.vim: -------------------------------------------------------------------------------- 1 | " Test escaping in replacement. 2 | 3 | edit text.txt 4 | 1SubstituteSelected/\<\(.\)\(.\)\2\>/\\\&\\1{\2:\1\0}\\1\&\\/g yn 5 | 3SubstituteSelected/foo/\\& and \&\\/gi yny 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4047-SubstituteSelected-replacements-expr.ok: -------------------------------------------------------------------------------- 1 | {o:ffoo}(1, foo, "foobar", fox[1], bar) && {o:ffoo}(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more txt! Foo and txt! 4 | -------------------------------------------------------------------------------- /tests/t4047-SubstituteSelected-replacements-expr.vim: -------------------------------------------------------------------------------- 1 | " Test replacement expression. 2 | 3 | edit text.txt 4 | 1SubstituteSelected/\<\(.\)\(.\)\2\>/\='{' . submatch(2) . ':' . submatch(1) . submatch(0) . '}'/g yn 5 | 3SubstituteSelected/foo/\=expand('%:e')/gi yny 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4060-SubstituteSelected-complex-answer.ok: -------------------------------------------------------------------------------- 1 | foo(1, XXX, "foobar", XXX[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's XXX my fault!". We agreed XXX shouted "yeah!" 3 | We need more foo! XXX and XXX! 4 | -------------------------------------------------------------------------------- /tests/t4060-SubstituteSelected-complex-answer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with a complex answer in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteSelected/\<...\>/XXX/g 2,yny,8-9,ny 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t4070-SubstituteSelected-repeat.ok: -------------------------------------------------------------------------------- 1 | XXX(1, foo, "foobar", XXX[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! Foo XXX foo! 4 | -------------------------------------------------------------------------------- /tests/t4070-SubstituteSelected-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and answers when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteSelected/\<...\>/XXX/g yn 5 | 3SubstituteSelected 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4080-SubstituteSelected-repeat-answers.ok: -------------------------------------------------------------------------------- 1 | XXX(1, foo, "foobar", XXX[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! XXX XXX foo! 4 | -------------------------------------------------------------------------------- /tests/t4080-SubstituteSelected-repeat-answers.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, and flags, but new answers when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteSelected/\<...\>/XXX/g yn 5 | 3SubstituteSelected nyy 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t4100-SubstituteUnderCursor.ok: -------------------------------------------------------------------------------- 1 | END(1, MIDDLE-FOO, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FIRST! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t4110-SubstituteUnderCursor-previous-search.ok: -------------------------------------------------------------------------------- 1 | FIRST(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FIRST! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t4110-SubstituteUnderCursor-previous-search.vim: -------------------------------------------------------------------------------- 1 | " Test replacing previous search pattern only under the cursor. 2 | 3 | edit text.txt 4 | 5 | let @/ = '\' 6 | 3normal! 3w 7 | SubstituteUnderCursor//FIRST/ 8 | 9 | 1normal! e 10 | SubstituteUnderCursor//~/ 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t4120-SubstituteUnderCursor-repeat.ok: -------------------------------------------------------------------------------- 1 | FIRST(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FIRST! FIRST and foo! 4 | -------------------------------------------------------------------------------- /tests/t4120-SubstituteUnderCursor-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags when replacing only under the cursor. 2 | 3 | edit text.txt 4 | 5 | 1normal! e 6 | SubstituteUnderCursor/\/FIRST/i 7 | 8 | 3normal! 3w 9 | SubstituteUnderCursor 10 | 3normal! 4W 11 | SubstituteUnderCursor 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t4125-SubstituteUnderCursor-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | FIRST(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! FIRST and foo! 4 | -------------------------------------------------------------------------------- /tests/t4125-SubstituteUnderCursor-repeat-flags.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of patterns and replacements under cursor when repeating with new flags. 2 | 3 | edit text.txt 4 | 5 | 3normal! 4W 6 | SubstituteUnderCursor/\/FIRST/ 7 | 8 | 3normal! 3w 9 | SubstituteUnderCursor e 10 | 1normal! e 11 | SubstituteUnderCursor i 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t4130-SubstituteUnderCursor-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pattern doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: .*doesNotExist', 'SubstituteUnderCursor/doesNotExist/REPLACEMENT/', 'Pattern not found error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t4135-SubstituteUnderCursor-no-previous-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test error when there's no previous pattern for an empty search under cursor. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | let @/ = '' 8 | call vimtap#err#Errors('No previous pattern', 'SubstituteUnderCursor//REPLACEMENT/', 'No previous pattern error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t4140-SubstituteUnderCursor-range-error.vim: -------------------------------------------------------------------------------- 1 | " Test error when range is given for search under cursor. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E481: No range allowed:', '%SubstituteUnderCursor//REPLACEMENT/', 'No range allowed error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5000-SubstituteInSearch-line.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5000-SubstituteInSearch-line.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in a single line. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | 1 6 | SubstituteInSearch/o/X/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5010-SubstituteInSearch-buffer.msgok: -------------------------------------------------------------------------------- 1 | 7 substitutions on 2 lines 2 | -------------------------------------------------------------------------------- /tests/t5010-SubstituteInSearch-buffer.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXX! FXX and fXX! 4 | -------------------------------------------------------------------------------- /tests/t5010-SubstituteInSearch-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | %SubstituteInSearch/o/X/g 6 | 7 | call vimtest#StartTap() 8 | call vimtap#Plan(1) 9 | call vimtap#Is(@/, '\<...\>', 'last search pattern not modified') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t5020-SubstituteInSearch-outer-flags.ok: -------------------------------------------------------------------------------- 1 | fXX(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXX! FXX and fXX! 4 | -------------------------------------------------------------------------------- /tests/t5020-SubstituteInSearch-outer-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with flags for the outer search. 2 | 3 | edit text.txt 4 | let @/ = '\' 5 | 1SubstituteInSearch/o/X/ 6 | 3SubstituteInSearch/o/X/gi 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5030-SubstituteInSearch-inner-flags.ok: -------------------------------------------------------------------------------- 1 | fXo(1, fXo, "foobar", fXx[1], bar) && fXo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5030-SubstituteInSearch-inner-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with flags for the inner search. 2 | 3 | edit text.txt 4 | let @/ = '\' 5 | 1SubstituteInSearch/o/X/gf 6 | 3SubstituteInSearch/o/X/f 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5040-SubstituteInSearch-count.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bXr) && fXX(bXz, looooony)[1]; 2 | ShX said, "It's NOT my fault!". We agreed Xnd shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5040-SubstituteInSearch-count.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with count. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | 1SubstituteInSearch/[aeiou]/X/g 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t5050-SubstituteInSearch-same-replacement.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more mXX! mXX mXX mXX! 4 | -------------------------------------------------------------------------------- /tests/t5050-SubstituteInSearch-same-replacement.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with the same replacement as before. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | 1SubstituteInSearch/o/X/g 6 | 7 | " Tests that the last replacement from :SubstituteInSearch is taken and that a 8 | " :substitute does not override it. 9 | 3substitute//moo/g 10 | 11 | 3SubstituteInSearch/o/~/g 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t5060-SubstituteInSearch-repeat.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shXuted "yeah!" 3 | We need more fXX! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5070-SubstituteInSearch-no-outer-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the outer pattern doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | let @/ = 'doesNotExist' 8 | call vimtap#err#ErrorsLike('^E486: .*: doesNotExist', '%SubstituteInSearch/x/O/g', 'Pattern not found error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t5080-SubstituteInSearch-no-inner-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the inner pattern doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | let @/ = '\<...\>' 8 | call vimtap#err#Errors('Pattern not found: doesNotExist', '%SubstituteInSearch/doesNotExist/XXX/g', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t5090-SubstituteInSearch-no-inner-matches-suppression.msgok: -------------------------------------------------------------------------------- 1 | 13 substitutions on 3 lines 2 | end 3 | -------------------------------------------------------------------------------- /tests/t5090-SubstituteInSearch-no-inner-matches-suppression.vim: -------------------------------------------------------------------------------- 1 | " Test suppression of the error when the inner pattern doesn't match. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | %SubstituteInSearch/doesNotExist/XXX/ge 6 | echomsg 'end' 7 | 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t5100-SubstituteInSearch-replacements-expr.ok: -------------------------------------------------------------------------------- 1 | foo(1, fFOO, "foobar", fFOX[1], bBAR) && foo(bBAZ, looooony)[1]; 2 | She said, "It's NOT my f[a]ult!". We agreed and shouted "y[e]ah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5110-SubstituteInSearch-inline.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXX! FXX and fXX! 4 | -------------------------------------------------------------------------------- /tests/t5110-SubstituteInSearch-inline.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer with inline search pattern. 2 | 3 | edit text.txt 4 | let @/ = 'unrelated' 5 | %SubstituteInSearch/\<...\>/o/X/g 6 | 7 | call vimtest#StartTap() 8 | call vimtap#Plan(1) 9 | call vimtap#Is(@/, 'unrelated', 'last search pattern not modified') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t5120-SubstituteInSearch-inline-flags.ok: -------------------------------------------------------------------------------- 1 | fXo(1, fXo, "foobar", fXx[1], bar) && fXo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXX! FXX and fXX! 4 | -------------------------------------------------------------------------------- /tests/t5120-SubstituteInSearch-inline-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer with inline search pattern and flags. 2 | 3 | edit text.txt 4 | let @/ = 'unrelated' 5 | 1SubstituteInSearch/\/o/X/gf 6 | 3SubstituteInSearch/\/o/X/gi 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5150-SubstituteInSearch-inline-same-replacement.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more mXX! mXX mXX mXX! 4 | -------------------------------------------------------------------------------- /tests/t5160-SubstituteInSearch-inline-repeat.ok: -------------------------------------------------------------------------------- 1 | fXo(1, fXo, "foobar", fXx[1], bXr) && fXo(bXz, looooony)[1]; 2 | She sXXd, "It's NXX my fault!". We agreed and shXXXXd "yeah!" 3 | We nXXd more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5170-SubstituteInSearch-inline-empty.ok: -------------------------------------------------------------------------------- 1 | fXX(1, fXX, "foobar", fXx[1], bar) && fXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more fXX! FXX and fXX! 4 | -------------------------------------------------------------------------------- /tests/t5170-SubstituteInSearch-inline-empty.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer with empty inline search pattern. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | %SubstituteInSearch//o/X/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t5200-SubstituteNotInSearch-line.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "fXXbar", fox[1], bar) && foo(baz, lXXXXXny)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5200-SubstituteNotInSearch-line.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in a single line. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | 1 6 | SubstituteNotInSearch/o/X/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5210-SubstituteNotInSearch-buffer.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "fXXbar", fox[1], bar) && foo(baz, lXXXXXny)[1]; 2 | She said, "It's NOT my fault!". We agreed and shXuted "yeah!" 3 | We need mXre foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5210-SubstituteNotInSearch-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer. 2 | 3 | edit text.txt 4 | let @/ = '\<...\>' 5 | %SubstituteNotInSearch/o/X/g 6 | 7 | call vimtest#StartTap() 8 | call vimtap#Plan(1) 9 | call vimtap#Is(@/, '\<...\>', 'last search pattern not modified') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t5220-SubstituteNotInSearch-outer-flags.ok: -------------------------------------------------------------------------------- 1 | fooXXXXfoo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need mXre foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5220-SubstituteNotInSearch-outer-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with flags for the outer search. 2 | 3 | edit text.txt 4 | let @/ = '\' 5 | 1SubstituteNotInSearch/./X/ 6 | 3SubstituteNotInSearch/o/X/gi 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5225-SubstituteNotInSearch-previous-search.ok: -------------------------------------------------------------------------------- 1 | my fXo#bar Xs do#ne Xn he#re fXr th#at 2 | -------------------------------------------------------------------------------- /tests/t5225-SubstituteNotInSearch-previous-search.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with the previous search. 2 | 3 | call setline(1, 'my foo#bar is do#ne in he#re for th#at') 4 | let @/ = '\w#\w' 5 | SubstituteNotInSearch@[io]@X@g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | 10 | -------------------------------------------------------------------------------- /tests/t5230-SubstituteNotInSearch-inner-flags.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "fXobar", fox[1], bar) && foo(baz, lXoooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | Xe need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5230-SubstituteNotInSearch-inner-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting with flags for the inner search. 2 | 3 | edit text.txt 4 | let @/ = '\' 5 | 1SubstituteNotInSearch/o/X/gf 6 | 3SubstituteNotInSearch/./X/f 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t5270-SubstituteNotInSearch-no-outer-matches.ok: -------------------------------------------------------------------------------- 1 | XXX(X, XXX, "XXXXXX", XXX[X], XXX) && XXX(XXX, XXXXXXXX)[X]; 2 | XXX XXXX, "XX'X XXX XX XXXXX!". XX XXXXXX XXX XXXXXXX "XXXX!" 3 | XX XXXX XXXX XXX! XXX XXX XXX! 4 | -------------------------------------------------------------------------------- /tests/t5270-SubstituteNotInSearch-no-outer-matches.vim: -------------------------------------------------------------------------------- 1 | " Test when the outer pattern doesn't match. 2 | 3 | edit text.txt 4 | let @/ = 'doesNotExist' 5 | %SubstituteNotInSearch/\w/X/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t5275-SubstituteNotInSearch-all-outer-matches.vim: -------------------------------------------------------------------------------- 1 | " Test when the outer pattern matches everywhere. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | let @/ = '.*' 8 | call vimtap#err#ErrorsLike('Pattern not found: .\+\.\*', '%SubstituteNotInSearch/\w/X/g', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t5310-SubstituteNotInSearch-inline.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "fXXbar", fox[1], bar) && foo(baz, lXXXXXny)[1]; 2 | She said, "It's NOT my fault!". We agreed and shXuted "yeah!" 3 | We need mXre foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5310-SubstituteNotInSearch-inline.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer with inline search pattern. 2 | 3 | edit text.txt 4 | let @/ = 'unrelated' 5 | %SubstituteNotInSearch/\<...\>/o/X/g 6 | 7 | call vimtest#StartTap() 8 | call vimtap#Plan(1) 9 | call vimtap#Is(@/, 'unrelated', 'last search pattern not modified') 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t5320-SubstituteNotInSearch-inline-flags.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "fXobar", fox[1], bar) && foo(baz, lXoooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need mXre foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t5320-SubstituteNotInSearch-inline-flags.vim: -------------------------------------------------------------------------------- 1 | " Test substituting in the buffer with inline search pattern and flags. 2 | 3 | edit text.txt 4 | let @/ = 'unrelated' 5 | 1SubstituteNotInSearch/\/o/X/gf 6 | 3SubstituteNotInSearch/\/o/X/gi 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t6000-SubstituteExcept-line.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo{redacted}fox{redacted}bar{redacted}foo{redacted}baz{redacted} 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t6000-SubstituteExcept-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing non-matches in a single line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteExcept/\<...\>/{redacted}/ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t6010-SubstituteExcept-buffer.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo{redacted}fox{redacted}bar{redacted}foo{redacted}baz{redacted} 2 | She{redacted}NOT{redacted}and{redacted} 3 | {redacted}foo{redacted}Foo{redacted}and{redacted}foo{redacted} 4 | -------------------------------------------------------------------------------- /tests/t6020-SubstituteExcept-flags.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | {redacted}said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | {redacted}foo{redacted}Foo{redacted}foo{redacted} 4 | -------------------------------------------------------------------------------- /tests/t6020-SubstituteExcept-flags.vim: -------------------------------------------------------------------------------- 1 | " Test replacing non-matches without and with other flags. 2 | 3 | edit text.txt 4 | 3SubstituteExcept/foo/{redacted}/gi 5 | set gdefault 6 | 1SubstituteExcept/\<...\>/{redacted}/g 7 | 2SubstituteExcept/\<\k*a\k*\>/{redacted}/g 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t6030-SubstituteExcept-no-matches.ok: -------------------------------------------------------------------------------- 1 | {redacted} 2 | 3 | {redacted} 4 | {redacted} 5 | {redacted} 6 | -------------------------------------------------------------------------------- /tests/t6030-SubstituteExcept-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pattern doesn't match. 2 | " Tests that empty lines remain empty, but when there's whitespace, it is 3 | " replaced. 4 | 5 | edit text.txt 6 | execute "2normal! o \" 7 | execute "1normal! o\" 8 | %SubstituteExcept/doesNotExist/{redacted}/ 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t6040-SubstituteExcept-replacements.ok: -------------------------------------------------------------------------------- 1 | foo{fo}foo{fo}fox{fx}bar{br}foo{fo}baz{bz} 2 | {}said{s}fault{f}agreed{}and{}yeah{ye} 3 | {We need more} foo{!} Foo {and} foo{!} 4 | -------------------------------------------------------------------------------- /tests/t6040-SubstituteExcept-replacements.vim: -------------------------------------------------------------------------------- 1 | " Test references in replacement. 2 | 3 | edit text.txt 4 | 1SubstituteExcept/\<\(.\).\(.\)\>/{\1\2}/ 5 | 2SubstituteExcept/\<\(\k*\)a\k*\>/{\1}/ 6 | 3SubstituteExcept/\s*foo\s*/{&}/i 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t6050-SubstituteExcept-replacements-special.ok: -------------------------------------------------------------------------------- 1 | foo{fo}foo{fo}fox{fx}bar{br}foo{fo}baz{bz} 2 | SHE said, "IT'S NOT MY fault!". WE agreed and SHOUTED "yeah!" 3 | {12 snipped} foo{1 snipped} Foo {3 snipped} foo{1 snipped} 4 | -------------------------------------------------------------------------------- /tests/t6050-SubstituteExcept-replacements-special.vim: -------------------------------------------------------------------------------- 1 | " Test special replacement. 2 | 3 | edit text.txt 4 | 1SubstituteExcept/\<\(.\).\(.\)\>/\='{'.submatch(1).submatch(2).'}'/ 5 | 2SubstituteExcept/\<\k*a\k*\>/\=toupper(submatch(0))/ 6 | 3SubstituteExcept/\s*foo\s*/\='{'.len(submatch(0)).' snipped}'/i 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t6060-SubstituteExcept-replacement-error.ok: -------------------------------------------------------------------------------- 1 | foofoo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t6070-SubstituteExcept-repeat.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo{redacted}fox{redacted}bar{redacted}foo{redacted}baz{redacted} 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | {redacted}foo{redacted}Foo{redacted}and{redacted}foo{redacted} 4 | -------------------------------------------------------------------------------- /tests/t6070-SubstituteExcept-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, and flags when repeating replacement. 2 | 3 | edit text.txt 4 | 1SubstituteExcept/\<...\>/{redacted}/ 5 | 3SubstituteExcept 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t6075-SubstituteExcept-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo{redacted}fox{redacted}foo{redacted} 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | {redacted}foo{redacted}Foo{redacted}foo{redacted} 4 | -------------------------------------------------------------------------------- /tests/t6075-SubstituteExcept-repeat-flags.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, but new flags when repeating replacement. 2 | 3 | edit text.txt 4 | 1SubstituteExcept/\/{redacted}/ 5 | 3SubstituteExcept i 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t6080-SubstituteExcept-subst-repeat.ok: -------------------------------------------------------------------------------- 1 | {REDACTED}(1, {redacted}, "foobar", {redacted}[1], bar) && {redacted}(baz, looooony)[1]; 2 | SHE said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | {redacted}foo{redacted}Foo{redacted}foo{redacted} 4 | -------------------------------------------------------------------------------- /tests/t6090-SubstituteExcept-count.ok: -------------------------------------------------------------------------------- 1 | foo{redacted}foo{redacted}fox{redacted}foo{redacted} 2 | {redacted}NOT{redacted} 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t6090-SubstituteExcept-count.vim: -------------------------------------------------------------------------------- 1 | " Test replacing non-matches with count. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteExcept/\<.o.\>/{redacted}/i 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t6100-DeleteExcept-line.ok: -------------------------------------------------------------------------------- 1 | foofoofoxbarfoobaz 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t6100-DeleteExcept-line.vim: -------------------------------------------------------------------------------- 1 | " Test deleting non-matches in a single line. 2 | 3 | edit text.txt 4 | 1 5 | DeleteExcept /\<...\>/ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t6110-DeleteExcept-buffer.ok: -------------------------------------------------------------------------------- 1 | foofoofoxbarfoobaz 2 | SheNOTand 3 | fooFooandfoo 4 | -------------------------------------------------------------------------------- /tests/t6110-DeleteExcept-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test deleting non-matches in the buffer. 2 | 3 | let @/ = 'initial' 4 | edit text.txt 5 | %DeleteExcept/\<...\>/ 6 | 7 | call vimtest#StartTap() 8 | call vimtap#Plan(2) 9 | call vimtap#Is(@/, '\<...\>', ':DeleteExcept sets last search pattern') 10 | call vimtap#Is(histget('search', -1), '\<...\>', ':DeleteExcept fills search history') 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t6115-DeleteExcept-bar.vim: -------------------------------------------------------------------------------- 1 | " Test command invocation with a pattern that contains a bar. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | try 7 | %DeleteExcept/\<...\|my\>/ 8 | call vimtap#Pass('bar is parsed as belonging inside the pattern') 9 | catch 10 | call vimtap#Fail('bar inside pattern should not end command') 11 | call vimtap#Diag(v:exception) 12 | endtry 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t6120-DeleteExcept-flags.ok: -------------------------------------------------------------------------------- 1 | foofoo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | fooFoofoo 4 | -------------------------------------------------------------------------------- /tests/t6120-DeleteExcept-flags.vim: -------------------------------------------------------------------------------- 1 | " Test deleting non-matches with other flags. 2 | 3 | edit text.txt 4 | 3DeleteExcept/foo/i 5 | set gdefault 6 | 1DeleteExcept/\<...\>/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t6130-DeleteExcept-no-matches.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/t6130-DeleteExcept-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pattern doesn't match. 2 | 3 | edit text.txt 4 | execute "2normal! o \" 5 | execute "1normal! o\" 6 | %DeleteExcept/doesNotExist/ 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t6180-DeleteExcept-subst-repeat.ok: -------------------------------------------------------------------------------- 1 | {REDACTED}(1, {redacted}, "foobar", {redacted}[1], bar) && {redacted}(baz, looooony)[1]; 2 | saidsmyfaultagreedandshoutedyeah 3 | foofoo 4 | -------------------------------------------------------------------------------- /tests/t7000-SubstituteWildcard-line.ok: -------------------------------------------------------------------------------- 1 | FOO(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7000-SubstituteWildcard-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing one pair match in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteWildcard foobar=hiho foo=FOO FOObar=XXXXXX 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7010-SubstituteWildcard-buffer.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7010-SubstituteWildcard-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all pair matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteWildcard foobar=hiho foo=FOO FOObar=XXXXXX g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7015-SubstituteWildcard-bar.vim: -------------------------------------------------------------------------------- 1 | " Test command invocation with a pair that contains a bar. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | try 7 | %SubstituteWildcard foo=F|O g 8 | call vimtap#Pass('bar is parsed as belonging inside the pair') 9 | catch 10 | call vimtap#Fail('bar inside pair should not end command') 11 | call vimtap#Diag(v:exception) 12 | endtry 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t7016-SubstituteWildcard-space.ok: -------------------------------------------------------------------------------- 1 | F \(1, F \, "F \bar", fox[1], bar) && F \(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed or shouted "yeah!" 3 | We need more F \! Foo or F \! 4 | -------------------------------------------------------------------------------- /tests/t7016-SubstituteWildcard-space.vim: -------------------------------------------------------------------------------- 1 | " Test command invocation with a pair that contains an escaped space. 2 | 3 | edit text.txt 4 | %SubstituteWildcard foo=F\ \\ \ and\ =\ or\ g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7020-SubstituteWildcard-flags.ok: -------------------------------------------------------------------------------- 1 | fXo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! FOO and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7020-SubstituteWildcard-flags.vim: -------------------------------------------------------------------------------- 1 | " Test replacing pair matches with flags. 2 | 3 | edit text.txt 4 | 3SubstituteWildcard foo=FOO gi 5 | set gdefault 6 | 1SubstituteWildcard o=X g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7030-SubstituteWildcard-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pair doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: \\(\\VdoesNotExist\\)', '%SubstituteWildcard doesNotExist=XXX', 'Pattern not found error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7040-SubstituteWildcard-count.ok: -------------------------------------------------------------------------------- 1 | fOO(1, fOO, "fOObar", fOx[1], bar) && fOO(baz, lOOOOOny)[1]; 2 | She Said, "It'S NOT My fault!". We agreed and ShOuted "yeah!" 3 | We need More foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7040-SubstituteWildcard-count.vim: -------------------------------------------------------------------------------- 1 | " Test replacing pair matches with count. 2 | 3 | edit text.txt 4 | 1SubstituteWildcard o=O g 2 5 | 1SubstituteWildcard s=S g2 6 | 1,2SubstituteWildcard m=M 2 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7050-SubstituteWildcard-invalid-tuple.vim: -------------------------------------------------------------------------------- 1 | " Test passing invalid pair. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#Errors('Not a substitution: no-pair', '%SubstituteWildcard FOO=BAR no-pair', 'error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7060-SubstituteWildcard-order.ok: -------------------------------------------------------------------------------- 1 | first(1, first, "firstbar", foX[1], bar) && first(baz, looooonY)[1]; 2 | She said, "It's NOT mY fault!". We agreed and shouted "Yeah!" 3 | We need more first! Foo and first! 4 | -------------------------------------------------------------------------------- /tests/t7060-SubstituteWildcard-order.vim: -------------------------------------------------------------------------------- 1 | " Test pair ordering when multiple same wildcards. 2 | 3 | edit text.txt 4 | %SubstituteWildcard x=X foo=first foo=second y=Y foo=third g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7070-SubstituteWildcard-wildcard-questionmark.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "XXXbar", XXX[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! Foo and XXX! 4 | -------------------------------------------------------------------------------- /tests/t7070-SubstituteWildcard-wildcard-questionmark.vim: -------------------------------------------------------------------------------- 1 | " Test pair with question mark wildcard. 2 | 3 | edit text.txt 4 | %SubstituteWildcard fo?=XXX g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7080-SubstituteWildcard-wildcard-star.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, nice)[1]; 2 | She said, "It's NOT my fault!". We laughed "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7080-SubstituteWildcard-wildcard-star.vim: -------------------------------------------------------------------------------- 1 | " Test pair with star wildcard. 2 | 3 | edit text.txt 4 | %SubstituteWildcard lo*y=nice agr*ed=laughed 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7090-SubstituteWildcard-wildcard-brackets.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "XXXbar", XXX[1], bar) && XXX(baz, looooony)[1]; 2 | S?e said, "It's NOT my fault!". We a?reed and s?outed "yea?!" 3 | We need more XXX! Foo and XXX! 4 | -------------------------------------------------------------------------------- /tests/t7090-SubstituteWildcard-wildcard-brackets.vim: -------------------------------------------------------------------------------- 1 | " Test pair with bracket wildcard. 2 | 3 | edit text.txt 4 | %SubstituteWildcard fo[ox]=XXX [gh]=? g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7100-SubstituteWildcard-reference-match.ok: -------------------------------------------------------------------------------- 1 | foofoo(1, foofoo, "foofoobar", foxfox[1], bar) && foofoo(baz, looooony)[1]; 2 | She said, "It's &NOT& my fault!". We agreed and shouted "yeah!" 3 | We need more \FOO\! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7100-SubstituteWildcard-reference-match.vim: -------------------------------------------------------------------------------- 1 | " Test referencing the match in the replacement. 2 | 3 | edit text.txt 4 | 1SubstituteWildcard fo[ox]=&& g 5 | 2SubstituteWildcard NOT=\&&\& 6 | 3SubstituteWildcard foo=\\FOO\\ 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7110-SubstituteWildcard-repeat.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7110-SubstituteWildcard-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, wildcards, and flags when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteWildcard foobar=hiho foo=FOO FOObar=XXXXXX g 5 | 3SubstituteWildcard 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7120-SubstituteWildcard-expression.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "FOObar", FOX[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and and shouted "yeah!" 3 | We need more FOO! Foo and and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7120-SubstituteWildcard-expression.vim: -------------------------------------------------------------------------------- 1 | " Test replacing pair matches with an expression. 2 | 3 | edit text.txt 4 | %SubstituteWildcard fo[ox]=\=toupper(submatch(0)) and=\=submatch(0).'\ '.submatch(0) g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7500-SubstituteMultiple-line.ok: -------------------------------------------------------------------------------- 1 | FOO(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7500-SubstituteMultiple-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing one pair match in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteMultiple /foobar/hiho/ /foo/FOO/ /FOObar/XXXXXX/ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7505-SubstituteMultiple-escaping.ok: -------------------------------------------------------------------------------- 1 | |/\(1, |/\, "hi/ho", fox[1], bar) && |/\(baz, looooony)[1]; 2 | She said, "It's NOT X X X fault!". We agreed and shouted "yeah!" 3 | We need more |/\! Foo and |/\! 4 | -------------------------------------------------------------------------------- /tests/t7505-SubstituteMultiple-escaping.vim: -------------------------------------------------------------------------------- 1 | " Test replacing one pair match in a line. 2 | 3 | edit text.txt 4 | 2substitute#my#my/her/our# 5 | %SubstituteMultiple /foobar/hi\/ho/ /foo/|\/\\/ /my\/her\/our/X X X/ g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7510-SubstituteMultiple-buffer.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7510-SubstituteMultiple-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all pair matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteMultiple /fo\+ba\+r/hiho/ #foo#FOO# @FOObar@XXXXXX@ g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7515-SubstituteMultiple-bar.vim: -------------------------------------------------------------------------------- 1 | " Test command invocation with a pair that contains a bar. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | try 7 | %SubstituteMultiple /foo/F|O/ g 8 | call vimtap#Pass('bar is parsed as belonging inside the pair') 9 | catch 10 | call vimtap#Fail('bar inside pair should not end command') 11 | call vimtap#Diag(v:exception) 12 | endtry 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t7516-SubstituteMultiple-space.ok: -------------------------------------------------------------------------------- 1 | F /(1, F /, "F /bar", fox[1], bar) && F /(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed or shouted "yeah!" 3 | We need more F /! Foo or F /! 4 | -------------------------------------------------------------------------------- /tests/t7516-SubstituteMultiple-space.vim: -------------------------------------------------------------------------------- 1 | " Test command invocation with a pair that contains a space. 2 | 3 | edit text.txt 4 | %SubstituteMultiple /foo/F \// # and # or # g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7520-SubstituteMultiple-flags.ok: -------------------------------------------------------------------------------- 1 | fXo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! FOO and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7520-SubstituteMultiple-flags.vim: -------------------------------------------------------------------------------- 1 | " Test replacing pair matches with flags. 2 | 3 | edit text.txt 4 | 3SubstituteMultiple /foo/FOO/ gi 5 | set gdefault 6 | 1SubstituteMultiple /o/X/ g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7530-SubstituteMultiple-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pair doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: \\(doesNotExist\\)', '%SubstituteMultiple /doesNotExist/XXX/', 'Pattern not found error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7540-SubstituteMultiple-count.ok: -------------------------------------------------------------------------------- 1 | fOO(1, fOO, "fOObar", fOx[1], bar) && fOO(baz, lOOOOOny)[1]; 2 | She Said, "It'S NOT My fault!". We agreed and ShOuted "yeah!" 3 | We need More foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7540-SubstituteMultiple-count.vim: -------------------------------------------------------------------------------- 1 | " Test replacing pair matches with count. 2 | 3 | edit text.txt 4 | 1SubstituteMultiple /o/O/ g 2 5 | 1SubstituteMultiple /s/S/ g2 6 | 1,2SubstituteMultiple /m/M/ 2 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7550-SubstituteMultiple-minimal-pair.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my !". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7550-SubstituteMultiple-minimal-pair.vim: -------------------------------------------------------------------------------- 1 | " Test passing a minimal pair consisting of only a pattern. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: \\(FOO\\)\\|\\(minimal-pair\\)', '%SubstituteMultiple /FOO/BAR/ minimal-pair', 'Pattern not found error shown') 8 | 9 | %SubstituteMultiple /FOO/BAR/ fault 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t7560-SubstituteMultiple-order.ok: -------------------------------------------------------------------------------- 1 | first(1, first, "firstbar", foX[1], bar) && first(baz, looooonY)[1]; 2 | She said, "It's NOT mY fault!". We agreed and shouted "Yeah!" 3 | We need more first! Foo and first! 4 | -------------------------------------------------------------------------------- /tests/t7560-SubstituteMultiple-order.vim: -------------------------------------------------------------------------------- 1 | " Test pair ordering when multiple same patterns. 2 | 3 | edit text.txt 4 | %SubstituteMultiple /x/X/ /foo/first/ /foo/second/ /y/Y/ /foo/third/ g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7570-SubstituteMultiple-separators.ok: -------------------------------------------------------------------------------- 1 | /!/(1, /!/, "hi/ho", fox[1], bar) && /!/(baz, looooony)[1]; 2 | She said, "It's NOT my error!!!". We agreed and shouted "yeah!" 3 | We need more /!/! Foo and /!/! 4 | -------------------------------------------------------------------------------- /tests/t7570-SubstituteMultiple-separators.vim: -------------------------------------------------------------------------------- 1 | " Test unescaping of different separators. 2 | 3 | edit text.txt 4 | %SubstituteMultiple /foobar/hi\/ho/ #foo#/!/# !fault\!!error\!\!\!! g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7580-SubstituteMultiple-magic.ok: -------------------------------------------------------------------------------- 1 | zup(1, zup, "zupbar", zupXXX, bar) && zup(baz, looooony)XXX; 2 | She said, "It's NOT my fault!"?We agreed and shouted "yeah!" 3 | We need more zup! Foo and zup! 4 | -------------------------------------------------------------------------------- /tests/t7580-SubstituteMultiple-magic.vim: -------------------------------------------------------------------------------- 1 | " Test changing magic. 2 | 3 | edit text.txt 4 | %SubstituteMultiple /\V[1]/XXX/ /\/\=submatch(0) . ' ' . submatch(0)/ g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7630-SubstituteMultipleExpr-line.ok: -------------------------------------------------------------------------------- 1 | FOO(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7630-SubstituteMultipleExpr-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing one pair match in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteMultipleExpr /['foobar', 'foo', 'FOObar']/['hiho', 'FOO', 'XXXXXX']/ 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7640-SubstituteMultipleExpr-buffer.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7640-SubstituteMultipleExpr-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all pair matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteMultipleExpr /['foobar', 'foo', 'FOObar']/['hiho', 'FOO', 'XXXXXX']/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7642-SubstituteMultipleExpr-string-split.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7642-SubstituteMultipleExpr-string-split.vim: -------------------------------------------------------------------------------- 1 | " Test that a multiline string is split for pattern and replacements. 2 | 3 | edit text.txt 4 | %SubstituteMultipleExpr /"foobar\nfoo\nFOObar"/"hiho\nFOO\nXXXXXX"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7644-SubstituteMultipleExpr-variable.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7644-SubstituteMultipleExpr-variable.vim: -------------------------------------------------------------------------------- 1 | " Test using a variable for pattern and replacements. 2 | 3 | edit text.txt 4 | let g:patterns = ['foobar', 'foo', 'FOObar'] 5 | let g:repl = ['hiho', 'FOO', 'XXXXXX'] 6 | %SubstituteMultipleExpr /g:patterns/g:repl/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7646-SubstituteMultipleExpr-function.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t7646-SubstituteMultipleExpr-function.vim: -------------------------------------------------------------------------------- 1 | " Test using a function for pattern and replacements. 2 | 3 | edit text.txt 4 | function! Patterns() 5 | return ['foobar', 'foo', 'FOObar'] 6 | endfunction 7 | function! Replacements() 8 | return ['hiho', 'FOO', 'XXXXXX'] 9 | endfunction 10 | %SubstituteMultipleExpr /Patterns()/Replacements()/g 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t7650-SubstituteMultipleExpr-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pair doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: \\(doesNotExist\\)', '%SubstituteMultipleExpr /"doesNotExist"/"XXX"/', 'Pattern not found error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7654-SubstituteMultipleExpr-capture-group.vim: -------------------------------------------------------------------------------- 1 | " Test using forbidden capture groups. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#Errors('Capture groups not allowed in pattern #2: f\(o\+\)', '%SubstituteMultipleExpr /["bar", ''f\(o\+\)'']/["XXX", "FOO"]/g', 'error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7656-SubstituteMultipleExpr-magic.ok: -------------------------------------------------------------------------------- 1 | zup(1, zup, "zupbar", zupXXX, bar) && zup(baz, looooony)XXX; 2 | She said, "It's NOT my fault!"?We agreed and shouted "yeah!" 3 | We need more zup! Foo and zup! 4 | -------------------------------------------------------------------------------- /tests/t7656-SubstituteMultipleExpr-magic.vim: -------------------------------------------------------------------------------- 1 | " Test changing magic. 2 | 3 | edit text.txt 4 | %SubstituteMultipleExpr /['\V[1]', '\', 'Foo']/['\=toupper(submatch(0))', '\=submatch(0) . " " . submatch(0)', 'OOF']/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7700-SubstituteChoices-line.ok: -------------------------------------------------------------------------------- 1 | BAR(1, QUUX, "BARbar", fox[1], bar) && BAZ(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7700-SubstituteChoices-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices in a line. 2 | 3 | let g:IngoLibrary_QueryChoices = ['BAR', 'QUUX', 'BAR', 'BAZ'] 4 | edit text.txt 5 | 1 6 | SubstituteChoices /foo/BAR/BAZ/QUUX/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7710-SubstituteChoices-reference-match.ok: -------------------------------------------------------------------------------- 1 | (foo)(1, [foo], "foobar", [1], {rab}) && 2 | f 3 | o 4 | o 5 | ((baz), looooony)[1]; 6 | She said, "It's NOT my fault!". We agreed [and] shouted "yeah!" 7 | We need more ! Foo {dna} 8 | f 9 | o 10 | o 11 | ! 12 | -------------------------------------------------------------------------------- /tests/t7710-SubstituteChoices-reference-match.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices that reference the match in various ways. 2 | 3 | let g:IngoLibrary_QueryChoices = [0, 1, 2, 3, 4, 0, 1, 2, 3, 4] 4 | edit text.txt 5 | 1 6 | %SubstituteChoices /\<\(\l\)\(\l\)\(\l\)\>/(&)/[&]/<\0\>/{\3\2\1}/\r\1\r\2\r\3\r/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7720-SubstituteChoices-abort.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7720-SubstituteChoices-abort.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices with an abort. 2 | 3 | let g:IngoLibrary_QueryChoices = ['BAR', -1] 4 | edit text.txt 5 | 1 6 | SubstituteChoices /foo/BAR/BAZ/QUUX/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7730-SubstituteChoices-confirm-quit.ok: -------------------------------------------------------------------------------- 1 | bar(1, quux, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | aaa said, "It's bbb my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7730-SubstituteChoices-confirm-quit.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices confirm quit. 2 | 3 | edit text.txt 4 | 5 | let g:IngoLibrary_QueryChoices = ['bar', 'quux', 'quit'] 6 | 1SubstituteChoices /foo/bar/baz/quux/gc 7 | 8 | let g:IngoLibrary_QueryChoices = ['aaa', 'bbb', 'quit'] 9 | 2,$SubstituteChoices /\<...\>/aaa/bbb/ccc/gc 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t7731-SubstituteChoices-confirm-all-remaining.ok: -------------------------------------------------------------------------------- 1 | bar(1, quux, "quuxbar", fox[1], bar) && quux(baz, looooony)[1]; 2 | aaa said, "It's bbb my fault!". We agreed bbb shouted "yeah!" 3 | We need more bbb! bbb bbb bbb! 4 | -------------------------------------------------------------------------------- /tests/t7731-SubstituteChoices-confirm-all-remaining.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices confirm all remaining. 2 | 3 | edit text.txt 4 | 5 | let g:IngoLibrary_QueryChoices = ['bar', 'quux', 'all remaining as quux'] 6 | 1SubstituteChoices /foo/bar/baz/quux/gc 7 | 8 | let g:IngoLibrary_QueryChoices = ['aaa', 'bbb', 'all remaining as bbb'] 9 | 2,$SubstituteChoices /\<...\>/aaa/bbb/ccc/gc 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t7732-SubstituteChoices-confirm-no.ok: -------------------------------------------------------------------------------- 1 | bar(1, foo, "foobar", fox[1], bar) && quux(baz, looooony)[1]; 2 | She said, "It's bbb my fault!". We agreed and shouted "yeah!" 3 | We need more aaa! Foo and aaa! 4 | -------------------------------------------------------------------------------- /tests/t7732-SubstituteChoices-confirm-no.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices confirm no. 2 | 3 | edit text.txt 4 | 5 | let g:IngoLibrary_QueryChoices = ['bar', 'no', 'no', 'quux'] 6 | 1SubstituteChoices /foo/bar/baz/quux/gc 7 | 8 | let g:IngoLibrary_QueryChoices = ['no', 'bbb', 'no', 'aaa', 'no', 'no', 'aaa'] 9 | 2,$SubstituteChoices /\<...\>/aaa/bbb/ccc/gc 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t7733-SubstituteChoices-confirm-last.ok: -------------------------------------------------------------------------------- 1 | bar(1, quux, "quuxbar", fox[1], bar) && foo(baz, looooony)[1]; 2 | aaa said, "It's bbb my fault!". We agreed bbb shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7733-SubstituteChoices-confirm-last.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices confirm last. 2 | 3 | edit text.txt 4 | 5 | let g:IngoLibrary_QueryChoices = ['bar', 'quux', 'last as quux'] 6 | 1SubstituteChoices /foo/bar/baz/quux/gc 7 | 8 | let g:IngoLibrary_QueryChoices = ['aaa', 'bbb', 'last as bbb'] 9 | 2,$SubstituteChoices /\<...\>/aaa/bbb/ccc/gc 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t7740-SubstituteMultiple-error.vim: -------------------------------------------------------------------------------- 1 | " Test error when less than two replacements are given. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(2) 5 | 6 | call vimtap#err#Errors('No replacement given', 'SubstituteChoices/foo//g', 'error shown') 7 | call vimtap#err#Errors('Only one replacement given', 'SubstituteChoices/foo/bar/g', 'error shown') 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7750-SubstituteChoices-escaping.ok: -------------------------------------------------------------------------------- 1 | FOO/BAR(1, |/\, "///bar", fox[1], bar) && FOO/BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7750-SubstituteChoices-escaping.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with choices containing an escaped separator. 2 | 3 | let g:IngoLibrary_QueryChoices = ['FOO/BAR', '|/\', '///', 'FOO/BAR'] 4 | edit text.txt 5 | 1 6 | SubstituteChoices /foo/FOO\/BAR/|\/\\/\/\/\//g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t7770-SubstituteChoices-repeat.ok: -------------------------------------------------------------------------------- 1 | BAR(1, QUUX, "BARbar", fox[1], bar) && BAZ(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more QUUX! Foo and BAZ! 4 | -------------------------------------------------------------------------------- /tests/t7770-SubstituteChoices-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and count when repeating substitution. 2 | 3 | let g:IngoLibrary_QueryChoices = ['BAR', 'QUUX', 'BAR', 'BAZ'] 4 | edit text.txt 5 | 1SubstituteChoices /foo/BAR/BAZ/QUUX/g 6 | let g:IngoLibrary_QueryChoices = ['QUUX', 'BAZ'] 7 | 3SubstituteChoices 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t7800-SubstituteIf-line.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "foobar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7800-SubstituteIf-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteIf /foo/BAR/g col('.') % 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7801-SubstituteUnless-line.ok: -------------------------------------------------------------------------------- 1 | foo(1, BAR, "BARbar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7801-SubstituteUnless-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with negated predicate in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteUnless /foo/BAR/g col('.') % 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7810-SubstituteIf-reference-match.ok: -------------------------------------------------------------------------------- 1 | {o:ffoo}(1, foo, "foobar", fox[1], bar) && {o:ffoo}(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and Foo and foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7810-SubstituteIf-reference-match.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with references with predicate. 2 | 3 | edit text.txt 4 | 1SubstituteIf/\<\(.\)\(.\)\2\>/{\2:\1\0}/g col('.') % 2 5 | 3SubstituteIf/foo/& and &/gi col('.') % 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7820-SubstituteIf-replacement-expr.ok: -------------------------------------------------------------------------------- 1 | {o:ffoo}(1, foo, "foobar", fox[1], bar) && {o:ffoo}(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! txt and txt! 4 | -------------------------------------------------------------------------------- /tests/t7820-SubstituteIf-replacement-expr.vim: -------------------------------------------------------------------------------- 1 | " Test replacement expression with predicate. 2 | 3 | edit text.txt 4 | 1SubstituteIf/\<\(.\)\(.\)\2\>/\='{' . submatch(2) . ':' . submatch(1) . submatch(0) . '}'/g col('.') % 2 5 | 3SubstituteIf/foo/\=expand('%:e')/gi col('.') % 2 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7830-SubstituteIf-bad-predicate.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7830-SubstituteIf-bad-predicate.vim: -------------------------------------------------------------------------------- 1 | " Test invalid predicate. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call vimtap#err#Errors('E121: Undefined variable: isnotvalid', '%SubstituteIf /foo/BAR/g isnotvalid)*#expr', 'error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t7850-SubstituteIf-val.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "BARbar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7850-SubstituteIf-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteIf /foo/BAR/g v:val.matchCount % 2 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7851-SubstituteIf-val.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "BARbar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7851-SubstituteIf-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteIf /foo/BAR/g v:val.replacementCount < 5 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7852-SubstituteIf-val.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "BARbar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and BAR! 4 | -------------------------------------------------------------------------------- /tests/t7852-SubstituteIf-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | function! Predicate( context ) 4 | let l:col = col('.') 5 | let l:seenCol = has_key(a:context.d, l:col) 6 | let a:context.d[l:col] = 1 7 | return ! l:seenCol 8 | endfunction 9 | edit text.txt 10 | %SubstituteIf /foo/BAR/g Predicate(v:val) 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t7870-SubstituteIf-repeat.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "foobar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and BAR! 4 | -------------------------------------------------------------------------------- /tests/t7870-SubstituteIf-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and predicate when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteIf /foo/BAR/g col('.') % 2 5 | 3SubstituteIf 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7871-SubstituteUnless-repeat.ok: -------------------------------------------------------------------------------- 1 | foo(1, BAR, "BARbar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7871-SubstituteUnless-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and predicate when repeating negated substitution. 2 | 3 | edit text.txt 4 | 1SubstituteUnless /foo/BAR/g col('.') % 2 5 | 3SubstituteUnless 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7872-SubstituteUnless-repeat-opposite.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "foobar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7872-SubstituteUnless-repeat-opposite.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and predicate when repeating substitution with negated one. 2 | 3 | edit text.txt 4 | 1SubstituteIf /foo/BAR/g col('.') % 2 5 | 3SubstituteUnless 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7880-SubstituteIf-repeat-predicate.ok: -------------------------------------------------------------------------------- 1 | BAR(1, foo, "foobar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7880-SubstituteIf-repeat-predicate.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, but new predicate when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteIf /foo/BAR/g col('.') % 2 5 | 3SubstituteIf col('.') % 2 == 0 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7900-SubstituteExecute-line.ok: -------------------------------------------------------------------------------- 1 | [FOO](1, [FOO], "[FOO]bar", fox[1], bar) && [FOO](baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7900-SubstituteExecute-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with expression in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteExecute /foo/g return '[' . toupper(submatch(0)) . ']' 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7910-SubstituteExecute-buffer.ok: -------------------------------------------------------------------------------- 1 | ooo(1, ooo, "foobar", FOX[1], BAR) && ooo(BAZ, looooony)[1]; 2 | HE said, "It's NOT my fault!". We agreed AND shouted "yeah!" 3 | We need more ooo! ooo AND ooo! 4 | -------------------------------------------------------------------------------- /tests/t7910-SubstituteExecute-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with expression in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteExecute /\<...\>/g if submatch(0) ==? 'foo' | return 'ooo' | elseif col('.') == 1 | return 'HE' | else | return toupper(submatch(0)) | endif 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7930-SubstituteExecute-bad-expression.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7930-SubstituteExecute-bad-expression.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with invalid expression. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call vimtap#err#Errors('E492: Not an editor command: doesnotevaluate)*#statement', '%SubstituteExecute /foo/g doesnotevaluate)*#statement', 'error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t7931-SubstituteExecute-throw-expression.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "XXXbar", fox[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7931-SubstituteExecute-throw-expression.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with expression that later throws. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call vimtap#err#Errors('Expression threw exception: BAAAH', '%SubstituteExecute /foo/g if line(".") == 3 | throw "BAAAH" | endif | return "XXX"', 'error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t7950-SubstituteExecute-val.ok: -------------------------------------------------------------------------------- 1 | XXX(1, YYY, "XXXbar", fox[1], bar) && YYY(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! Foo and YYY! 4 | -------------------------------------------------------------------------------- /tests/t7950-SubstituteExecute-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with expression that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteExecute /foo/g return v:val.matchCount % 2 ? 'XXX' : 'YYY' 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7951-SubstituteExecute-val.ok: -------------------------------------------------------------------------------- 1 | XXX(1, YYY, "YYYbar", fox[1], bar) && XXX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more YYY! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7951-SubstituteExecute-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with expression that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteExecute /foo/g if v:val.replacementCount < 5 | return col('.') % 2 ? 'XXX' : 'YYY' | endif 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7952-SubstituteExecute-val.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "BARbar", fox[1], bar) && BAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and BAR! 4 | -------------------------------------------------------------------------------- /tests/t7952-SubstituteExecute-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteExecute /foo/g let l:col = col('.') | let l:seenCol = has_key(v:val.d, l:col) | let v:val.d[l:col] = 1 | if ! l:seenCol | return "BAR" | endif 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7953-SubstituteExecute-val.ok: -------------------------------------------------------------------------------- 1 | ???(1, foo, "foobar", foo[1], fox) && bar(foo, looooony)[1]; 2 | baz said, "It's She my fault!". We agreed NOT shouted "yeah!" 3 | We need more and! foo Foo and! 4 | -------------------------------------------------------------------------------- /tests/t7953-SubstituteExecute-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteExecute /\<...\>/g let prev = v:val.s | let v:val.s = submatch(0) | return (empty(prev) ? '???' : prev) 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7954-SubstituteExecute-val.ok: -------------------------------------------------------------------------------- 1 | 1foo(1, 2foo, "foobar", 3fox[1], 4bar) && 5foo(6baz, looooony)[1]; 2 | 7She said, "It's 8NOT my fault!". We agreed 9and shouted "yeah!" 3 | We need more 10foo! 11Foo 12and 13foo! 4 | -------------------------------------------------------------------------------- /tests/t7954-SubstituteExecute-val.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with predicate that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteExecute /\<...\>/g return v:val.matchCount . submatch(0) 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t7970-SubstituteExecute-repeat.ok: -------------------------------------------------------------------------------- 1 | [FOO](1, [FOO], "[FOO]bar", fox[1], bar) && [FOO](baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more [FOO]! Foo and [FOO]! 4 | -------------------------------------------------------------------------------- /tests/t7970-SubstituteExecute-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, flags, and expression when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteExecute /foo/g return '[' . toupper(submatch(0)) . ']' 5 | 3SubstituteExecute 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7980-SubstituteExecute-repeat-expression.ok: -------------------------------------------------------------------------------- 1 | [FOO](1, [FOO], "[FOO]bar", fox[1], bar) && [FOO](baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more {FOO}! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t7980-SubstituteExecute-repeat-expression.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, flags, but new expression when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteExecute /foo/g return '[' . toupper(submatch(0)) . ']' 5 | 3SubstituteExecute return '{' . toupper(submatch(0)) . '}' 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7985-SubstituteExecute-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | 1foo(1, 1foo, "foobar", 2fox[1], 3bar) && 4foo(5baz, looooony)[1]; 2 | 2She said, "It's 6NOT my fault!". We agreed 7and shouted "yeah!" 3 | We need more 3foo! 8Foo 9and 10foo! 4 | -------------------------------------------------------------------------------- /tests/t7985-SubstituteExecute-repeat-flags.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, expression, but new flags when repeating substitution. 2 | 3 | edit text.txt 4 | %SubstituteExecute /\<...\>/ return v:val.matchCount . submatch(0) 5 | %SubstituteExecute g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t7991-SubstituteExecute-cursor-no-change.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 5 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 6 | We need more foo! Foo and foo! 7 | -------------------------------------------------------------------------------- /tests/t8000-DeleteRanges.msgok: -------------------------------------------------------------------------------- 1 | 5 fewer lines 2 | 3 | 4 fewer lines 4 | -------------------------------------------------------------------------------- /tests/t8000-DeleteRanges.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | } 7 | intermediate 8 | { 9 | } 10 | { 11 | } 12 | end 13 | middle 14 | EOF 15 | -------------------------------------------------------------------------------- /tests/t8000-DeleteRanges.vim: -------------------------------------------------------------------------------- 1 | " Test deletion of ranges. 2 | 3 | edit ranges.txt 4 | 5 | " Tests that ranges are taken and considered. 6 | /middle/,$DeleteRanges /begin/,/end/ 7 | 8 | " Tests that the command defaults to the entire buffer. 9 | DeleteRanges /{/+1,/}/-1 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t8010-DeleteRanges-register.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | } 7 | intermediate 8 | { 9 | } 10 | { 11 | } 12 | end 13 | middle 14 | EOF 15 | -------------------------------------------------------------------------------- /tests/t8020-DeleteRanges-no-matching-ranges.vim: -------------------------------------------------------------------------------- 1 | " Test error when there are no ranges to be deleted. 2 | 3 | edit ranges.txt 4 | 5 | call vimtest#StartTap() 6 | call vimtap#Plan(1) 7 | 8 | call vimtap#err#Errors('No matching ranges', '%DeleteRanges /doesnot/,/exists/', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8030-DeleteRanges-numeric.ok: -------------------------------------------------------------------------------- 1 | begin 2 | { 3 | ha 4 | } 5 | intermediate 6 | { 7 | hi 8 | he 9 | ho 10 | } 11 | { 12 | } 13 | end 14 | zzz 15 | bar 16 | end 17 | EOF 18 | -------------------------------------------------------------------------------- /tests/t8030-DeleteRanges-numeric.vim: -------------------------------------------------------------------------------- 1 | " Test deletion of numeric ranges. 2 | " Tests that lines outside the command's range are ignored. 3 | 4 | edit ranges.txt 5 | 6 | " Tests that ranges are taken and considered. 7 | /middle/,$DeleteRanges 14,19 8 | 2,/intermediate/DeleteRanges 1,4 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8035-DeleteRanges-marks.ok: -------------------------------------------------------------------------------- 1 | begin 2 | { 3 | ha 4 | } 5 | intermediate 6 | { 7 | hi 8 | he 9 | ho 10 | } 11 | { 12 | } 13 | end 14 | zzz 15 | bar 16 | end 17 | EOF 18 | -------------------------------------------------------------------------------- /tests/t8035-DeleteRanges-marks.vim: -------------------------------------------------------------------------------- 1 | " Test deletion of marked ranges. 2 | " Tests that lines outside the command's range are ignored. 3 | 4 | edit ranges.txt 5 | 6 | 14normal! ma 7 | 19normal! mb 8 | 2normal! mc 9 | 10 | " Tests that ranges are taken and considered. 11 | /middle/,$DeleteRanges 'a,'b 12 | 2,/intermediate/DeleteRanges 'c-1,'c+2 13 | 14 | call vimtest#SaveOut() 15 | call vimtest#Quit() 16 | -------------------------------------------------------------------------------- /tests/t8050-DeleteRanges-inverted.msgok: -------------------------------------------------------------------------------- 1 | 2 fewer lines 2 | 3 | 12 fewer lines 4 | -------------------------------------------------------------------------------- /tests/t8050-DeleteRanges-inverted.ok: -------------------------------------------------------------------------------- 1 | ha 2 | hi 3 | he 4 | ho 5 | middle 6 | begin 7 | foo 8 | zzz 9 | bar 10 | -------------------------------------------------------------------------------- /tests/t8050-DeleteRanges-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test deletion of everything except ranges. 2 | 3 | set report=1 4 | edit ranges.txt 5 | 6 | /middle/+1,$DeleteRanges! /begin/,/end/-1 7 | 1,/middle/-1DeleteRanges! /{/+1,/}/-1 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8060-DeleteRanges-multiple.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | } 7 | intermediate 8 | { 9 | } 10 | { 11 | } 12 | end 13 | EOF 14 | -------------------------------------------------------------------------------- /tests/t8070-DeleteRanges-fold.ok: -------------------------------------------------------------------------------- 1 | ha 2 | hi 3 | he 4 | ho 5 | middle 6 | EOF 7 | -------------------------------------------------------------------------------- /tests/t8070-DeleteRanges-fold.vim: -------------------------------------------------------------------------------- 1 | " Test deletion of ranges in the current fold. 2 | " Tests that all folded lines are considered, not just the cursor line. 3 | 4 | edit ranges.txt 5 | 6 | 1,/middle/-1fold 7 | /middle/,$fold 8 | 9 | $DeleteRanges /begin/,/end/ 10 | 1DeleteRanges! /{/+1,/}/-1 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t8150-YankRanges-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test yanking of everything except ranges. 2 | 3 | edit ranges.txt 4 | setlocal nomodifiable 5 | 6 | let @@ = '' 7 | 8 | call vimtest#StartTap() 9 | call vimtap#Plan(2) 10 | YankRanges! /begin/,/end/ 11 | call vimtap#Is(@@, "middle\nEOF\n", 'Yanked except range /begin/,/end/') 12 | call vimtap#Ok(! &l:modified, 'Buffer not modified') 13 | 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t8200-PrintRanges.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 18 begin 3 | 19 foo 4 | 20 zzz 5 | 21 bar 6 | 22 end 7 | 8 | end 9 | -------------------------------------------------------------------------------- /tests/t8200-PrintRanges.vim: -------------------------------------------------------------------------------- 1 | " Test printing of ranges. 2 | 3 | edit ranges.txt 4 | setlocal nomodifiable 5 | 6 | " Tests that ranges are taken and considered. 7 | echomsg 'start' 8 | /middle/,$PrintRanges /begin/,/end/ 9 | echomsg 'end' 10 | 11 | call vimtest#StartTap() 12 | call vimtap#Plan(1) 13 | call vimtap#Ok(! &l:modified, 'buffer not modified') 14 | 15 | call vimtest#Quit() 16 | -------------------------------------------------------------------------------- /tests/t8230-PrintRanges-jumplist.vim: -------------------------------------------------------------------------------- 1 | " Test navigation of blocks of ranges. 2 | 3 | let s:lnums = [15, 9, 5, 1] 4 | call vimtest#StartTap() 5 | call vimtap#Plan(len(s:lnums)) 6 | 7 | edit ranges.txt 8 | setlocal nomodifiable 9 | 1 10 | PrintRanges /{/,/}/ 11 | 12 | for s:lnum in s:lnums 13 | call vimtap#Is(getpos('.')[1:2], [s:lnum, 1], 'jump position') 14 | execute "normal! \" 15 | endfor 16 | 17 | call vimtest#Quit() 18 | -------------------------------------------------------------------------------- /tests/t8250-PrintRanges-inverted.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 3 | 1 begin 4 | 2 foo 5 | 3 aaa 6 | 4 bar 7 | 5 { 8 | 7 } 9 | 8 intermediate 10 | 9 { 11 | 13 } 12 | 14 { 13 | 15 } 14 | 16 end 15 | 16 | end 17 | 18 | start 19 | 17 middle 20 | 22 end 21 | 23 EOF 22 | 23 | end 24 | -------------------------------------------------------------------------------- /tests/t8250-PrintRanges-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test printing of everything except ranges. 2 | 3 | edit ranges.txt 4 | 5 | echomsg 'start' 6 | 1,/middle/-1PrintRanges! /{/+1,/}/-1 7 | echomsg 'end' 8 | echomsg 'start' 9 | /middle/,$PrintRanges! /begin/,/end/-1 10 | echomsg 'end' 11 | 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t8260-PrintRanges-multiple.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 3 | 6 ha 4 | 10 hi 5 | 11 he 6 | 12 ho 7 | 17 middle 8 | 18 begin 9 | 19 foo 10 | 20 zzz 11 | 21 bar 12 | 22 end 13 | end 14 | -------------------------------------------------------------------------------- /tests/t8260-PrintRanges-multiple.vim: -------------------------------------------------------------------------------- 1 | " Test printing of multiple ranges. 2 | 3 | edit ranges.txt 4 | setlocal nomodifiable 5 | 6 | " Tests that ranges are taken and considered. 7 | echomsg 'start' 8 | 4,$PrintRanges /begin/,/end/ /{/+1,/}/-1 11 17 /foo/,/bar/ 9 | echomsg 'end' 10 | 11 | call vimtest#StartTap() 12 | call vimtap#Plan(1) 13 | call vimtap#Ok(! &l:modified, 'Buffer not modified') 14 | 15 | call vimtest#Quit() 16 | -------------------------------------------------------------------------------- /tests/t8270-PrintRanges-multiple-inverted.msgok: -------------------------------------------------------------------------------- 1 | start 2 | 3 | 4 bar 4 | 5 { 5 | 7 } 6 | 8 intermediate 7 | 9 { 8 | 13 } 9 | 14 { 10 | 15 } 11 | 16 end 12 | 23 EOF 13 | end 14 | -------------------------------------------------------------------------------- /tests/t8270-PrintRanges-multiple-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test printing of everything except multiple ranges. 2 | 3 | edit ranges.txt 4 | 5 | " Tests that ranges are taken and considered. 6 | echomsg 'start' 7 | 4,$PrintRanges! /begin/,/end/ /{/+1,/}/-1 11 17 /foo/,/bar/ 8 | echomsg 'end' 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8300-RangeDo.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | h(a) 7 | } 8 | intermediate 9 | { 10 | h(i) 11 | h(e) 12 | h(o) 13 | } 14 | { 15 | } 16 | end 17 | middle 18 | # begin 19 | # foo 20 | # zzz 21 | # bar 22 | # end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8300-RangeDo.vim: -------------------------------------------------------------------------------- 1 | " Test command execution over ranges. 2 | 3 | edit ranges.txt 4 | 5 | " Tests that ranges are taken and considered. 6 | /middle/,$RangeDo /begin/,/end/ execute "normal! I# \" 7 | 8 | " Tests that the command defaults to the entire buffer. 9 | RangeDo /{/+1,/}/-1 substitute/\S$/(&)/ 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t8310-RangeDo-error.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo foo 3 | aaa aaa 4 | bar bar 5 | { 6 | ha 7 | } 8 | intermediate 9 | { 10 | hi 11 | he 12 | ho 13 | } 14 | { 15 | } 16 | end 17 | middle 18 | begin 19 | foo 20 | zzz 21 | bar 22 | end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8315-RangeDo-bar.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | ha 7 | } 8 | intermediate 9 | { 10 | hi 11 | he 12 | ho 13 | } 14 | { 15 | } 16 | end 17 | middle 18 | ( begin ) 19 | ( foo ) 20 | ( zzz ) 21 | ( bar ) 22 | ( end ) 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8320-RangeDo-no-matching-ranges.vim: -------------------------------------------------------------------------------- 1 | " Test error when there are no ranges to be executed on. 2 | 3 | edit ranges.txt 4 | 5 | call vimtest#StartTap() 6 | call vimtap#Plan(1) 7 | 8 | call vimtap#err#Errors('No matching ranges', '%RangeDo /doesnot/,/exists/ delete _', 'error shown') 9 | 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8330-RangeDo-numeric.ok: -------------------------------------------------------------------------------- 1 | begin 2 | fo(o) 3 | aa(a) 4 | ba(r) 5 | { 6 | ha 7 | } 8 | intermediate 9 | { 10 | hi 11 | he 12 | ho 13 | } 14 | { 15 | } 16 | end 17 | # middle 18 | # begin 19 | # foo 20 | zzz 21 | bar 22 | end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8330-RangeDo-numeric.vim: -------------------------------------------------------------------------------- 1 | " Test command execution over numeric ranges. 2 | " Tests that lines outside the command's range are ignored. 3 | 4 | edit ranges.txt 5 | 6 | " Tests that ranges are taken and considered. 7 | /middle/,$RangeDo 14,19 execute "normal! I# \" 8 | 2,/intermediate/RangeDo 1,4 substitute/\S$/(&)/ 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8335-RangeDo-marks.ok: -------------------------------------------------------------------------------- 1 | begin 2 | fo(o) 3 | aa(a) 4 | ba(r) 5 | { 6 | ha 7 | } 8 | intermediate 9 | { 10 | hi 11 | he 12 | ho 13 | } 14 | { 15 | } 16 | end 17 | # middle 18 | # begin 19 | # foo 20 | zzz 21 | bar 22 | end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8350-RangeDo-inverted.ok: -------------------------------------------------------------------------------- 1 | begi(n) 2 | fo(o) 3 | aa(a) 4 | ba(r) 5 | ({) 6 | ha 7 | (}) 8 | intermediat(e) 9 | ({) 10 | hi 11 | he 12 | ho 13 | (}) 14 | ({) 15 | (}) 16 | en(d) 17 | middle 18 | begin 19 | foo 20 | zzz 21 | bar 22 | # end 23 | # EOF 24 | -------------------------------------------------------------------------------- /tests/t8350-RangeDo-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test command execution over everything except ranges. 2 | 3 | edit ranges.txt 4 | 5 | /middle/+1,$RangeDo! /begin/,/end/-1 execute "normal! I# \" 6 | 1,/middle/-1RangeDo! /{/+1,/}/-1 substitute/\S$/(&)/ 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t8360-RangeDo-multiple.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | bar 5 | { 6 | # ha 7 | } 8 | intermediate 9 | { 10 | # hi 11 | # he 12 | # ho 13 | } 14 | { 15 | } 16 | end 17 | # middle 18 | # begin 19 | # foo 20 | # zzz 21 | # bar 22 | # end 23 | EOF 24 | -------------------------------------------------------------------------------- /tests/t8360-RangeDo-multiple.vim: -------------------------------------------------------------------------------- 1 | " Test command execution over multiple ranges. 2 | 3 | edit ranges.txt 4 | 5 | 4,$RangeDo /begin/,/end/ /{/+1,/}/-1 11 17 /foo/,/bar/ execute "normal! I# \" 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t8370-RangeDo-multiple-inverted.ok: -------------------------------------------------------------------------------- 1 | begin 2 | foo 3 | aaa 4 | # bar 5 | # { 6 | ha 7 | # } 8 | # intermediate 9 | # { 10 | hi 11 | he 12 | ho 13 | # } 14 | # { 15 | # } 16 | # end 17 | middle 18 | begin 19 | foo 20 | zzz 21 | bar 22 | end 23 | # EOF 24 | -------------------------------------------------------------------------------- /tests/t8370-RangeDo-multiple-inverted.vim: -------------------------------------------------------------------------------- 1 | " Test command execution over everything except multiple ranges. 2 | 3 | edit ranges.txt 4 | 5 | 4,$RangeDo! /begin/,/end/ /{/+1,/}/-1 11 17 /foo/,/bar/ execute "normal! I# \" 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t8380-RangeDo-additions.ok: -------------------------------------------------------------------------------- 1 | begin 2 | vvv 3 | foo 4 | --- 5 | aaa 6 | --- 7 | bar 8 | --- 9 | { 10 | ha 11 | } 12 | intermediate 13 | { 14 | hi 15 | he 16 | ho 17 | } 18 | { 19 | } 20 | end 21 | --- 22 | middle 23 | begin 24 | vvv 25 | foo 26 | --- 27 | zzz 28 | --- 29 | bar 30 | --- 31 | end 32 | --- 33 | EOF 34 | -------------------------------------------------------------------------------- /tests/t8380-RangeDo-additions.vim: -------------------------------------------------------------------------------- 1 | " Test command execution that adds lines. 2 | 3 | set autoindent 4 | 5 | edit ranges.txt 6 | 7 | RangeDo /begin/,/end/ if getline('.') =~# 'foo' | execute "normal! Ovvv\j" | endif | if getline('.') =~# '\<...\>' | execute "normal! o---\" | endif 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8390-RangeDo-deletions.ok: -------------------------------------------------------------------------------- 1 | begin 2 | bar 3 | { 4 | ha 5 | intermediate 6 | { 7 | hi 8 | ho 9 | { 10 | } 11 | end 12 | middle 13 | begin 14 | bar 15 | end 16 | EOF 17 | -------------------------------------------------------------------------------- /tests/t8390-RangeDo-deletions.vim: -------------------------------------------------------------------------------- 1 | " Test command execution that deletes lines. 2 | 3 | edit ranges.txt 4 | 5 | RangeDo /begin/,/end/ if getline('.') =~# 'foo' | .,+1delete _ | endif | if getline('.') =~# '\<..\>' | .+1 delete _ | endif 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t8400-Renumber.vim: -------------------------------------------------------------------------------- 1 | " Test simple global / first renumbering. 2 | 3 | edit numbers.txt 4 | 5 | 4Renumber g 6 | 19,22Renumber 7 | 25 8 | .Renumber g 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8405-Renumber-default-range.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering of entire buffer. 2 | 3 | edit numbers.txt 4 | 5 | 3 " Move away from the first line. 6 | Renumber g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t8410-Renumber-start.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with different start. 2 | 3 | edit numbers.txt 4 | 5 | 4Renumber 5 g 6 | 16Renumber g 7 | 19,22Renumber -3 8 | 25Renumber -2 g 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8420-Renumber-start-offset.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with different start and offset. 2 | 3 | edit numbers.txt 4 | 5 | 4Renumber 5 g 10 6 | 19,22Renumber -3 -1 7 | 25Renumber -20g10 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t8430-Renumber-pattern.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering of other pattern. 2 | 3 | edit numbers.txt 4 | 5 | Renumber /\\|\/g 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8435-Renumber-empty-pat-fmt.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with empty pattern and format. 2 | 3 | edit numbers.txt 4 | 5 | 2Renumber ///g 6 | 4Renumber 10//g 7 | 19,22Renumber /// 8 | 25Renumber /\//g 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t8440-Renumber-fmt.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with different format. 2 | 3 | call vimtest#SkipAndQuitIf(! has('float'), 'Need support for +float') 4 | 5 | edit numbers.txt 6 | 7 | 2Renumber 9//%5d/g 8 | 4Renumber //0x%04X/g 9 | 6,9Renumber 75//%-4d/25 10 | 25Renumber -1//%G/g *100 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t8450-Renumber-floats.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with floats. 2 | 3 | call vimtest#SkipAndQuitIf(! has('float'), 'Need support for +float') 4 | 5 | edit numbers.txt 6 | 7 | 2Renumber g 0.1 8 | 4Renumber 0.5 g 0.5 9 | 6,9Renumber 2.0//%2.2f/0.333333333 10 | 19,22Renumber 1.0e6 g 1.5e5 11 | 29Renumber 0.0 g -0.01 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t8460-Renumber-offset-multiply.vim: -------------------------------------------------------------------------------- 1 | " Test renumbering with multiplicator offset. 2 | 3 | call vimtest#SkipAndQuitIf(! has('float'), 'Need support for +float') 4 | 5 | edit numbers.txt 6 | 7 | 2Renumber 2 g *2 8 | 19,20Renumber 0.2 g *16 9 | 21,24Renumber 5.36870912e7 g *6.25e-2 10 | 25Renumber 10/-1\|\\|\/g *10 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t8481-Renumber-only-priming.vim: -------------------------------------------------------------------------------- 1 | " Test priming itself does not change the buffer. 2 | 3 | edit numbers.txt 4 | 5 | 0Renumber 10 10 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9000-SubstituteSubsequent-line.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in XXX a XXX XXX XXX bartender. 8 | E foox 9 | E my bar is YYY my foo! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t9000-SubstituteSubsequent-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances after the cursor in a single line. 2 | 3 | edit duplicates.txt 4 | 7normal! 6W 5 | SubstituteSubsequent/\<...\>/XXX/g 6 | 9normal! 3W 7 | SubstituteSubsequent/\<...\>/YYY/ 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9010-SubstituteSubsequent-buffer.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in XXX a XXX XXX XXX bartender. 8 | E foox 9 | E my XXX is XXX my XXX! 10 | E XXX 11 | -------------------------------------------------------------------------------- /tests/t9010-SubstituteSubsequent-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances after the cursor in the remainder of the buffer. 2 | 3 | edit duplicates.txt 4 | 7normal! 6W 5 | .,$SubstituteSubsequent/\<...\>/XXX/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9020-SubstituteSubsequent-selected.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | . bar 3 | E baz 4 | . spaz 5 | . spaz 6 | E fooxy 7 | . the bar hih is in XXX a bar XXX the bartender. 8 | . foox 9 | E my bar is YYY my foo! 10 | . YYY 11 | -------------------------------------------------------------------------------- /tests/t9025-SubstituteSubsequent-previous-search.ok: -------------------------------------------------------------------------------- 1 | my foo#bar is do#ne in hXXXe for tXXXt 2 | -------------------------------------------------------------------------------- /tests/t9025-SubstituteSubsequent-previous-search.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances of the previous search after the cursor in a single line. 2 | 3 | call setline(1, 'my foo#bar is do#ne in he#re for th#at') 4 | 1normal! 4W 5 | let @/ = '\w#\w' 6 | SubstituteSubsequent##XXX#g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9050-SubstituteSubsequent-pattern-start-line.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in hih a bar for the bartender. 8 | . foox 9 | . my bar is not my foo! 10 | . eof 11 | -------------------------------------------------------------------------------- /tests/t9050-SubstituteSubsequent-pattern-start-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances after the cursor anchored to the start of the line. 2 | 3 | edit duplicates.txt 4 | 7normal! 6W 5 | .,$SubstituteSubsequent/^E/./g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9060-SubstituteSubsequent-blockwise-flag.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar XXX is in XXX a XXX XXX XXX bartender. 8 | E foox 9 | E my bar is XXX my XXX! 10 | E eof 11 | -------------------------------------------------------------------------------- /tests/t9060-SubstituteSubsequent-blockwise-flag.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances after the cursor column in all following lines. 2 | 3 | edit duplicates.txt 4 | 7normal! 3W 5 | .,$SubstituteSubsequent/\<...\>/XXX/gb 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9070-SubstituteSubsequent-fold.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in XXX a XXX XXX XXX bartender. 8 | E foox 9 | E my XXX is XXX my XXX! 10 | E XXX 11 | -------------------------------------------------------------------------------- /tests/t9070-SubstituteSubsequent-fold.vim: -------------------------------------------------------------------------------- 1 | " Test replacing instances after the cursor in the fold. 2 | 3 | edit duplicates.txt 4 | 7normal! 5W 5 | 7,$fold 6 | .SubstituteSubsequent/\<...\>/XXX/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9070-SubstituteSubsequent-repeat.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in XXX a bar XXX the bartender. 8 | E foox 9 | E my bar is XXX my foo! 10 | E XXX 11 | -------------------------------------------------------------------------------- /tests/t9070-SubstituteSubsequent-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, flags, and answers when repeating substitution. 2 | 3 | edit duplicates.txt 4 | 5 | " Tests within the current line. 6 | 7normal! 6W 7 | SubstituteSubsequent/\<...\>/XXX/g yn 8 | 9 | " Tests within the remainder of the buffer. 10 | 9normal! 3W 11 | .,$SubstituteSubsequent 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t9080-SubstituteSubsequent-repeat-answers.ok: -------------------------------------------------------------------------------- 1 | E foo 2 | E bar 3 | E baz 4 | E spaz 5 | E spaz 6 | E fooxy 7 | E the bar hih is in XXX a bar XXX the bartender. 8 | E foox 9 | E my bar is not my XXX! 10 | E XXX 11 | -------------------------------------------------------------------------------- /tests/t9080-SubstituteSubsequent-repeat-answers.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, replacement, and flags, but new answers when repeating substitution. 2 | 3 | edit duplicates.txt 4 | 5 | " Tests within the current line. 6 | 7normal! 6W 7 | SubstituteSubsequent/\<...\>/XXX/g yn 8 | 9 | " Tests within the remainder of the buffer. 10 | 9normal! 3W 11 | .,$SubstituteSubsequent nyy 12 | 13 | call vimtest#SaveOut() 14 | call vimtest#Quit() 15 | -------------------------------------------------------------------------------- /tests/t9100-SubstituteTranslate-line.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9100-SubstituteTranslate-line.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches through an enumeration of items in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9101-SubstituteTranslate-line-persist.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! XXX YYY BAR! 4 | -------------------------------------------------------------------------------- /tests/t9101-SubstituteTranslate-line-persist.vim: -------------------------------------------------------------------------------- 1 | " Test translating persisted matches through an enumeration of items in a line. 2 | " Test that new items appended to existing ones are used. 3 | " Test that pattern can be omitted. 4 | 5 | edit text.txt 6 | 1 7 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 8 | 9 | 3SubstituteTranslate //BAR/BAZ/QUX/QUY/XXX/YYY/g 10 | 11 | call vimtest#SaveOut() 12 | call vimtest#Quit() 13 | -------------------------------------------------------------------------------- /tests/t9102-SubstituteTranslate-line-persist-i.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! BAR XXX BAR! 4 | -------------------------------------------------------------------------------- /tests/t9102-SubstituteTranslate-line-persist-i.vim: -------------------------------------------------------------------------------- 1 | " Test translating persisted matches through an enumeration of items in a line, now with case-insensitive matching. 2 | " Test that new items are used. 3 | 4 | edit text.txt 5 | 1 6 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 7 | 8 | 3SubstituteTranslate /\<...\>/XXX/YYY/gi 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t9105-SubstituteTranslate-escaped-item.ok: -------------------------------------------------------------------------------- 1 | B/R(1, B/R, "foobar", |/\[1], Q/X) && B/R(Q/Y, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9105-SubstituteTranslate-escaped-item.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches through an enumeration of items in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/B\/R/|\/\\/Q\/X/Q\/Y/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9110-SubstituteTranslate-buffer-not-enough.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more BAR! Foo and BAR! 4 | -------------------------------------------------------------------------------- /tests/t9110-SubstituteTranslate-buffer-not-enough.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches in the buffer, with not enough items. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | call vimtap#err#Errors('Incomplete substitution: Need 4 more items', '%SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g', 'error shown') 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9111-SubstituteTranslate-buffer-persist.ok: -------------------------------------------------------------------------------- 1 | BARI(1, BARI, "foobar", BAZI[1], QUXI) && BARI(QUYI, looooony)[1]; 2 | AAAA said, "It's BBBB my fault!". We agreed CCCC shouted "yeah!" 3 | We need more BARI! DDDD CCCC BARI! 4 | -------------------------------------------------------------------------------- /tests/t9111-SubstituteTranslate-buffer-persist.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches in the buffer in two calls. 2 | 3 | edit text.txt 4 | silent! %SubstituteTranslate /\<...\>/BARI/BAZI/QUXI/QUYI/g 5 | %SubstituteTranslate //AAAA/BBBB/CCCC/DDDD/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9115-SubstituteTranslate-empty-match.ok: -------------------------------------------------------------------------------- 1 | fooBAR(1, fooBAR, "fooBAZ", fox[1], bar) && fooBAR(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9115-SubstituteTranslate-empty-match.vim: -------------------------------------------------------------------------------- 1 | " Test translating empty match. 2 | 3 | edit text.txt 4 | 1SubstituteTranslate /foo\zs\w*/BAR/BAZ/QUX/QUY/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9120-SubstituteTranslate-expression.ok: -------------------------------------------------------------------------------- 1 | AfoofooZ(1, AfoofooZ, "foobar", AfoxfoxZ[1], AbarbarZ) && AfoofooZ(AbazbazZ, looooony)[1]; 2 | ASheSheZ said, "It's ANOTNOTZ my fault!". We agreed AandandZ shouted "yeah!" 3 | We need more AfoofooZ! AFooFooZ AandandZ AfoofooZ! 4 | -------------------------------------------------------------------------------- /tests/t9120-SubstituteTranslate-expression.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with an expression. 2 | 3 | edit text.txt 4 | %SubstituteTranslate /\<...\>/\='A' . submatch(0) . submatch(0) . 'Z'/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9125-SubstituteTranslate-expression.ok: -------------------------------------------------------------------------------- 1 | AAA(1, AAA, "foobar", BBB[1], CCC) && AAA(DDD, looooony)[1]; 2 | EEE said, "It's FFF my fault!". We agreed GGG shouted "yeah!" 3 | We need more AAA! HHH GGG AAA! 4 | -------------------------------------------------------------------------------- /tests/t9125-SubstituteTranslate-expression.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with another expression. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | let g:items = ['AAA', 'BBB', 'CCC', 'DDD', 'EEE', 'FFF', 'GGG', 'HHH', 'III'] 8 | %SubstituteTranslate /\<...\>/\=remove(g:items, 0)/g 9 | 10 | call vimtap#Is(g:items, ['III'], 'one item left in List') 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t9130-SubstituteTranslate-bad-expression.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9130-SubstituteTranslate-bad-expression.vim: -------------------------------------------------------------------------------- 1 | " Test replacing with invalid expression. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | call vimtap#err#Errors('E121: Undefined variable: doesnotevaluate', '%SubstituteTranslate /\<...\>/\=doesnotevaluate/g', 'error shown') 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9140-SubstituteTranslate-missing-expression.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9140-SubstituteTranslate-missing-expression.vim: -------------------------------------------------------------------------------- 1 | " Test missing expression. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(2) 6 | call vimtap#err#Errors('Missing {expr}/{func}/{item1}...', '%SubstituteTranslate /\<...\>//g', 'error shown') 7 | call vimtap#err#Errors('Missing {expr}/{func}/{item1}...', '%SubstituteTranslate /\<...\>/\=/g', 'error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9150-SubstituteTranslate-val.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox2[1], bar3) && foo1(baz4, looooony)[1]; 2 | She5 said, "It's NOT6 my fault!". We agreed and7 shouted "yeah!" 3 | We need more foo1! Foo8 and7 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9150-SubstituteTranslate-val.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with an expression that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteTranslate /\<...\>/\=submatch(0) . v:val.matchCount/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9151-SubstituteTranslate-val.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox3[1], bar4) && foo1(baz6, looooony)[1]; 2 | She7 said, "It's NOT8 my fault!". We agreed and9 shouted "yeah!" 3 | We need more foo1! Foo11 and9 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9151-SubstituteTranslate-val.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with an expression that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteTranslate /\<...\>/\=submatch(0) . (v:val.replacementCount + 1)/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9152-SubstituteTranslate-val.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", foo-fox[1], foo-fox-bar) && foo(foo-fox-bar-baz, looooony)[1]; 2 | foo-fox-bar-baz-She said, "It's foo-fox-bar-baz-She-NOT my fault!". We agreed foo-fox-bar-baz-She-NOT-and shouted "yeah!" 3 | We need more foo! foo-fox-bar-baz-She-NOT-and-Foo foo-fox-bar-baz-She-NOT-and foo! 4 | -------------------------------------------------------------------------------- /tests/t9152-SubstituteTranslate-val.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with an expression that uses v:val. 2 | 3 | edit text.txt 4 | %SubstituteTranslate /\<...\>/\=join(add(v:val.l, submatch(0)), '-')/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9155-SubstituteTranslate-api-val.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox2[1], bar3) && foo1(baz4, looooony)[1]; 2 | She5 said, "It's NOT6 my fault!". We agreed and7 shouted "yeah!" 3 | We need more foo1! Foo8 and7 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9155-SubstituteTranslate-api-val.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches via API with an expression that uses v:val. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call vimtap#Is(PatternsOnText#Translate#Translate('', '%', 0, '/', '\<...\>', 'submatch(0) . v:val.matchCount', 'g'), 1, 'translate with expression') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9160-SubstituteTranslate-funcref.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox2[1], bar3) && foo1(baz4, looooony)[1]; 2 | She5 said, "It's NOT6 my fault!". We agreed and7 shouted "yeah!" 3 | We need more foo1! Foo8 and7 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9160-SubstituteTranslate-funcref.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with a Funcref that uses the argument. 2 | 3 | function! MyFunc( context ) 4 | return submatch(0) . a:context.matchCount 5 | endfunction 6 | edit text.txt 7 | %SubstituteTranslate /\<...\>/MyFunc/g 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9161-SubstituteTranslate-funcref-throw.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "foobar", FOX[1], BAR) && FOO(BAZ, looooony)[1]; 2 | SHE said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t9165-SubstituteTranslate-api-funcref.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox2[1], bar3) && foo1(baz4, looooony)[1]; 2 | She5 said, "It's NOT6 my fault!". We agreed and7 shouted "yeah!" 3 | We need more foo1! Foo8 and7 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9170-SubstituteTranslate-skip.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox23[1], bar31) && foo1(baz, looooony)[1]; 2 | She1 said, "It's NOT17 my fault!". We agreed and shouted "yeah!" 3 | We need more foo1! Foo19 and23 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9170-SubstituteTranslate-skip.vim: -------------------------------------------------------------------------------- 1 | " Test translating matches with an expression that skips some matches. 2 | 3 | edit text.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | 7 | call vimtap#err#Errors('Incomplete substitution: Need 2 more items', "%SubstituteTranslate /\\<...\\>/\\=col('.') > 36 ? [] : submatch(0) . col('.')/g", 'incomplete error') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9180-SubstituteTranslate-repeat.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox6[1], bar7) && foo1(baz8, looooony)[1]; 2 | She4 said, "It's NOT5 my fault!". We agreed and3 shouted "yeah!" 3 | We need more foo1! Foo2 and3 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9180-SubstituteTranslate-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, flags, and expression when repeating substitution. 2 | 3 | edit text.txt 4 | 3SubstituteTranslate /\<...\>/\=submatch(0) . v:val.matchCount/g 5 | 2SubstituteTranslate 6 | 1SubstituteTranslate 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9185-SubstituteTranslate-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She2 said, "It's NOT3 my fault!". We agreed and4 shouted "yeah!" 3 | We need more foo1! foo1 and4 foo1! 4 | -------------------------------------------------------------------------------- /tests/t9185-SubstituteTranslate-repeat-flags.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, expression, but new flags when repeating substitution. 2 | 3 | edit text.txt 4 | 1SubstituteTranslate /\<...\>/\=submatch(0) . v:val.matchCount/ 5 | 2SubstituteTranslate g 6 | 3SubstituteTranslate gi 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9190-SubstituteTranslate-reset.ok: -------------------------------------------------------------------------------- 1 | foo1(1, foo1, "foobar", fox2[1], bar3) && foo1(baz4, looooony)[1]; 2 | 1She said, "It's 2NOT my fault!". We agreed 3and shouted "yeah!" 3 | We need more 4foo! 5Foo 3and 4foo! 4 | -------------------------------------------------------------------------------- /tests/t9190-SubstituteTranslate-reset.vim: -------------------------------------------------------------------------------- 1 | " Test clearing memoizations and context object. 2 | 3 | edit text.txt 4 | 1SubstituteTranslate /\<...\>/\=submatch(0) . v:val.matchCount/g 5 | 2,3SubstituteTranslate! /\<...\>/\=v:val.matchCount . submatch(0) /g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9195-SubstituteTranslate-reset-items.ok: -------------------------------------------------------------------------------- 1 | GGG(1, GGG, "foobar", HHH[1], III) && GGG(JJJ, looooony)[1]; 2 | KKK AAAA, "BBBB LLL my fault!". We agreed MMM shouted "CCCC!" 3 | We DDDD EEEE GGG! NNN MMM GGG! 4 | -------------------------------------------------------------------------------- /tests/t9195-SubstituteTranslate-reset-items.vim: -------------------------------------------------------------------------------- 1 | " Test clearing memoizations of items. 2 | 3 | edit text.txt 4 | %SubstituteTranslate! /\<...\>/GGG/HHH/III/JJJ/KKK/LLL/MMM/NNN/OOO/PPP/g 5 | %SubstituteTranslate! /\<....\>/AAAA/BBBB/CCCC/DDDD/EEEE/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9200-PutTranslations.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | BAR: foo 5 | BAZ: fox 6 | QUX: bar 7 | QUY: baz 8 | -------------------------------------------------------------------------------- /tests/t9200-PutTranslations.vim: -------------------------------------------------------------------------------- 1 | " Test putting the translations at the end of the buffer with the default template. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 6 | 7 | $PutTranslations 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9205-PutTranslations-line0.ok: -------------------------------------------------------------------------------- 1 | BAR: foo 2 | BAZ: fox 3 | QUX: bar 4 | QUY: baz 5 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 6 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 7 | We need more foo! Foo and foo! 8 | -------------------------------------------------------------------------------- /tests/t9205-PutTranslations-line0.vim: -------------------------------------------------------------------------------- 1 | " Test putting the translations at the beginning of the buffer with the default template. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 6 | 7 | 0PutTranslations 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9206-PutTranslations-current-line.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | BAR: foo 4 | BAZ: fox 5 | QUX: bar 6 | QUY: baz 7 | We need more foo! Foo and foo! 8 | -------------------------------------------------------------------------------- /tests/t9206-PutTranslations-current-line.vim: -------------------------------------------------------------------------------- 1 | " Test putting the translations at the current line with the default template. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 6 | 7 | 2 8 | PutTranslations 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t9210-PutTranslations-custom-template.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | 1: [BAR]=[foo], 2: [BAZ]=[fox], 3: [QUX]=[bar], 4: [QUY]=[baz], 5 | -------------------------------------------------------------------------------- /tests/t9210-PutTranslations-custom-template.vim: -------------------------------------------------------------------------------- 1 | " Test putting the translations at the end of the buffer with a customized template. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTranslate /\<...\>/BAR/BAZ/QUX/QUY/g 6 | 7 | $PutTranslations v:val.count . ': [' . v:val.replacement . ']=[' . v:val.match . '], ' 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9230-PutTranslations-none-yet.vim: -------------------------------------------------------------------------------- 1 | " Test putting no translations yet done. 2 | 3 | edit text.txt 4 | 5 | call vimtest#StartTap() 6 | call vimtap#Plan(1) 7 | 8 | call vimtap#err#Errors('No translations yet', '$PutTranslations', 'no translations error') 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t9250-YankTranslations.ok: -------------------------------------------------------------------------------- 1 | BAR(1, BAR, "foobar", BAZ[1], QUX) && BAR(QUY, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9310-SubstituteTransactional-line.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She-She said, "It's NOT-NOT my fault!". We agreed and-and shouted "yeah!" 3 | We need more four! three two one! 4 | -------------------------------------------------------------------------------- /tests/t9310-SubstituteTransactional-line.vim: -------------------------------------------------------------------------------- 1 | " Test replacing matches in a line. 2 | 3 | edit text.txt 4 | 1 5 | SubstituteTransactional /\<...\>/XXX/g 6 | 2SubstituteTransactional /\<...\>/&-&/g 7 | let g:replacements = ['one', 'two', 'three', 'four', 'five'] 8 | 3SubstituteTransactional /\<...\>/\=remove(g:replacements, 0)/g 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t9315-SubstituteTransactional-zero-width.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!?". We agreed and shouted "yeah!?" 3 | We need more foo!? Foo and foo!? 4 | -------------------------------------------------------------------------------- /tests/t9315-SubstituteTransactional-zero-width.vim: -------------------------------------------------------------------------------- 1 | " Test replacing zero-width matches. 2 | 3 | edit text.txt 4 | %SubstituteTransactional /!\zs/?/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9317-SubstituteTransactional-lastLnum.ok: -------------------------------------------------------------------------------- 1 | one(1, two, "foobar", three[1], four) && five(six, looooony)[1]; 2 | seven said, "It's eight my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9320-SubstituteTransactional-context.ok: -------------------------------------------------------------------------------- 1 | 1/6(1, 2/6, "foobar", 3/6[1], 4/6) && 5/6(6/6, looooony)[1]; 2 | [She] said, "It's [NOT] my fault!". We agreed [and] shouted "yeah!" 3 | We need more [14-16]! [19-21] [23-25] [27-29]! 4 | -------------------------------------------------------------------------------- /tests/t9320-SubstituteTransactional-context.vim: -------------------------------------------------------------------------------- 1 | " Test replacing matches using the context. 2 | 3 | edit text.txt 4 | 1SubstituteTransactional #\<...\>#\=v:val.matchCount . '/' . v:val.matchNum#g 5 | 2SubstituteTransactional /\<...\>/\='[' . v:val.matchText . ']'/g 6 | 3SubstituteTransactional /\<...\>/\='[' . v:val.startPos[1] . '-' . v:val.endPos[1] . ']'/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9325-SubstituteTransactional-expr-position.ok: -------------------------------------------------------------------------------- 1 | <1foo(1,>(1, <8foo,>, "foobar", <23fox[1],>[1], <31bar)>) && <39foo(<43foo(baz,>,>(<43foo(baz,>, looooony)[1]; 2 | <1She> said, "It's <17NOT> my fault!". We agreed <43and> shouted "yeah!" 3 | We need more <14foo!>! <19Foo> <23and> <27foo!>! 4 | -------------------------------------------------------------------------------- /tests/t9325-SubstituteTransactional-expr-position.vim: -------------------------------------------------------------------------------- 1 | " Test replacing matches using the match position. 2 | 3 | edit text.txt 4 | %SubstituteTransactional /\<...\>/\='<' . col('.') . expand('') . '>'/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9327-SubstituteTransactional-expr-matches.vim: -------------------------------------------------------------------------------- 1 | " Test the recorded matches. 2 | 3 | edit enumeration.txt 4 | 1,4SubstituteTransactional /\[\w\+\]/\=v:val.matchText . "/" . v:val.matches[v:val.matchCount]/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9328-SubstituteTransactional-expr-arbitrary-matches.vim: -------------------------------------------------------------------------------- 1 | " Test access of arbitrary recorded matches. 2 | 3 | edit enumeration.txt 4 | 1,4SubstituteTransactional /\[\w\+\]/\=v:val.matches[v:val.matchNum - v:val.matchCount + 1]/g 5 | 6 | 7,12SubstituteTransactional /\[\w\+\]/\=v:val.matchText . "/" . v:val.matches[v:val.matchNum]/g 7 | 8 | call vimtest#SaveOut() 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9330-SubstituteTransactional-test-expr-skip.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", 1-FOX[1], 2-BAR) && foo(3-BAZ, looooony)[1]; 2 | 4-SHE said, "It's 5-NOT my fault!". We agreed 6-AND shouted "yeah!" 3 | We need more foo! 7-FOO 8-AND foo! 4 | -------------------------------------------------------------------------------- /tests/t9330-SubstituteTransactional-test-expr-skip.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to skip matches. 2 | 3 | edit text.txt 4 | %SubstituteTransactional /\<...\>/\=v:val.matchCount . '-' . toupper(v:val.matchText)/gt/if submatch(0)=='foo'|throw 'skip'|endif/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9335-SubstituteTransactional-test-expr-capture.ok: -------------------------------------------------------------------------------- 1 | 6:FOO-18(1, 6:FOO-18, "foobar", 6:FOX-18[1], 6:BAR-18) && 6:FOO-18(6:BAZ-18, looooony)[1]; 2 | 3: said, "It': my fault!". We agreed 3: shouted "yeah!" 3 | We need more 4:FOO! 4:FOO 4:AND 4:FOO! 4 | -------------------------------------------------------------------------------- /tests/t9340-SubstituteTransactional-update-predicate.ok: -------------------------------------------------------------------------------- 1 | (1, , "foobar", [1], ) && (, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! FOO AND FOO! 4 | -------------------------------------------------------------------------------- /tests/t9345-SubstituteTransactional-test-update-predicate.ok: -------------------------------------------------------------------------------- 1 | YYY(1, YYY, "foobar", YYY[1], YYY) && YYY(YYY, looooony)[1]; 2 | YYY said, "It's YYY my fault!". We agreed YYY shouted "yeah!" 3 | We need more YYY! YYY YYY YYY! 4 | -------------------------------------------------------------------------------- /tests/t9350-SubstituteTransactional-repeat.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9355-SubstituteTransactional-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! XXX XXX XXX! 4 | -------------------------------------------------------------------------------- /tests/t9360-SubstituteTransactional-api.ok: -------------------------------------------------------------------------------- 1 | YYY(1, YYY, "foobar", YYY[1], YYY) && YYY(YYY, looooony)[1]; 2 | YYY said, "It's YYY my fault!". We agreed YYY shouted "yeah!" 3 | We need more YYY! YYY YYY YYY! 4 | -------------------------------------------------------------------------------- /tests/t9400-SubstituteTransactionalExpr-buffer.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t9400-SubstituteTransactionalExpr-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['foobar', 'foo', 'FOObar']/['hiho', 'FOO', 'XXXXXX']/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9402-SubstituteTransactionalExpr-string-split.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "hiho", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t9402-SubstituteTransactionalExpr-string-split.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /"foobar\nfoo\nFOObar"/"hiho\nFOO\nXXXXXX"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9410-SubstituteTransactionalExpr-no-matches.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9410-SubstituteTransactionalExpr-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pattern doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: \\(doesNotExist\\)', '%SubstituteTransactionalExpr /"doesNotExist"/"XXX"/', 'Pattern not found error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9414-SubstituteTransactionalExpr-capture-group.vim: -------------------------------------------------------------------------------- 1 | " Test using forbidden capture groups. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit text.txt 7 | call vimtap#err#Errors('Capture groups not allowed in pattern #2: f\(o\+\)', '%SubstituteTransactionalExpr /["bar", ''f\(o\+\)'']/["XXX", "FOO"]/g', 'error shown') 8 | 9 | call vimtest#Quit() 10 | -------------------------------------------------------------------------------- /tests/t9416-SubstituteTransactionalExpr-magic.ok: -------------------------------------------------------------------------------- 1 | zup(1, zup, "zupbar", zupXXX, bar) && zup(baz, looooony)XXX; 2 | She said, "It's NOT my fault!"?We agreed and shouted "yeah!" 3 | We need more zup! Foo and zup! 4 | -------------------------------------------------------------------------------- /tests/t9416-SubstituteTransactionalExpr-magic.vim: -------------------------------------------------------------------------------- 1 | " Test changing magic. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['\V[1]', '\ 12/19 shouted "[yeah]!" 3 | We [need] [more] 16/19! 17/19 18/19 19/19! 4 | -------------------------------------------------------------------------------- /tests/t9430-SubstituteTransactionalExpr-context.vim: -------------------------------------------------------------------------------- 1 | " Test replacing matches using the context. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr #['\<...\>', '\<....\>', '\']#["\\=v:val.matchCount . '/' . v:val.matchNum", "\\='[' . v:val.matchText . ']'", "\\='<' . v:val.startPos[1] . '-' . v:val.endPos[1] . '>'"]#g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9440-SubstituteTransactionalExpr-test-expr-skip.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", 1-FOX[1], 2-BAR) && foo(3-BAZ, looooony)[1]; 2 | 4-SHE said, "It's 5-NOT my fault!". We 6-AGREED 7-AND shouted "yeah!" 3 | We need more foo! 8-FOO 9-AND foo! 4 | -------------------------------------------------------------------------------- /tests/t9440-SubstituteTransactionalExpr-test-expr-skip.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to skip matches. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['\<...\>', '\']/"\\=v:val.matchCount . '-' . toupper(v:val.matchText)"/gt/if submatch(0)=='foo'|throw 'skip'|endif/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9445-SubstituteTransactionalExpr-test-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | 1-FOO(1, 2-FOO, "foobar", 3-FOX[1], 4-BAR) && 5-FOO(6-BAZ, looooony)[1]; 2 | 7-SHE said, "It's 8-NOT my fault!". We agreed 9-AND shouted "yeah!" 3 | We need more foo! Foo 10-AND foo! 4 | -------------------------------------------------------------------------------- /tests/t9445-SubstituteTransactionalExpr-test-expr-patternIndex.vim: -------------------------------------------------------------------------------- 1 | " Test using patternIndex within test expression to skip matches. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['\%3l\<[Ff]oo\>', '\<...\>']/"\\=v:val.matchCount . '-' . toupper(v:val.matchText)"/gt/if v:val.patternIndex == 0|throw 'skip'|endif/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9450-SubstituteTransactionalExpr-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | 1-FOO(1, 2-FOO, "foobar", 3-FOX[1], 4-BAR) && 5-FOO(6-BAZ, looooony)[1]; 2 | 7-SHE said, "It's 8-NOT my fault!". We agreed 9-AND shouted "yeah!" 3 | We need more foo! Foo 12-AND foo! 4 | -------------------------------------------------------------------------------- /tests/t9450-SubstituteTransactionalExpr-expr-patternIndex.vim: -------------------------------------------------------------------------------- 1 | " Test using patternIndex within replacement expression. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['\%3l\<[Ff]oo\>', '\<...\>']/"\\=v:val.patternIndex == 0 ? v:val.matchText : v:val.matchCount . '-' . toupper(v:val.matchText)"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9460-SubstituteTransactionalExpr-test-expr-capture.ok: -------------------------------------------------------------------------------- 1 | 8:FOO(1, 8:FOO, "foobar", 8:FOX8:[1], 8:BAR) && 8:FOO(8:BAZ, looooony)8:[1]; 2 | 3:SHE said, "It's 3:NOT my fault!". We agreed 3:AND shouted "yeah!" 3 | We need more 4:FOO! 4:FOO 4:AND 4:FOO! 4 | -------------------------------------------------------------------------------- /tests/t9460-SubstituteTransactionalExpr-test-expr-capture.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to capture additional information. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExpr /['\<...\>', '\[1\]']/"\\=v:val.d[line('.')] . ':' . toupper(v:val.matchText)"/gt/let v:val.d[line('.')] = get(v:val.d, line('.'), 0) + 1/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9470-SubstituteTransactionalExpr-update-predicate.ok: -------------------------------------------------------------------------------- 1 | (1, , "foobar", <[1]>, ) && (, looooony)<[1]>; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! FOO AND FOO! 4 | -------------------------------------------------------------------------------- /tests/t9475-SubstituteTransactionalExpr-test-update-predicate.ok: -------------------------------------------------------------------------------- 1 | YYY(1, YYY, "foobar", YYY[1], YYY) && YYY(YYY, looooony)[1]; 2 | YYY said, "It's YYY my fault!". We agreed YYY shouted "yeah!" 3 | We need more YYY! YYY YYY YYY! 4 | -------------------------------------------------------------------------------- /tests/t9480-SubstituteTransactionalExpr-repeat.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9485-SubstituteTransactionalExpr-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! XXX XXX XXX! 4 | -------------------------------------------------------------------------------- /tests/t9490-SubstituteTransactionalExpr-api.ok: -------------------------------------------------------------------------------- 1 | YYY(1, YYY, "foobar", YYY[1], YYY) && YYY(YYY, looooony)[1]; 2 | YYY said, "It's YYY my fault!". We agreed YYY shouted "yeah!" 3 | We need more YYY! YYY YYY YYY! 4 | -------------------------------------------------------------------------------- /tests/t9500-SubstituteTransactionalExprEach-buffer.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "FOOohu", fox[1], bar) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t9500-SubstituteTransactionalExprEach-buffer.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all matches in the buffer. 2 | 3 | edit text.txt 4 | " Note: Need to add /e flag to suppress error about /FOObar/ not found. 5 | %SubstituteTransactionalExprEach /['foobar', 'foo', 'FOObar']/['hihohu', 'FOO', 'XXXXXX']/ge 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9502-SubstituteTransactionalExprEach-string-split.ok: -------------------------------------------------------------------------------- 1 | FOOX(1, FOOX, "FOOXohuppala", fox[1], bar) && FOOX(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOOX! Foo and FOOX! 4 | -------------------------------------------------------------------------------- /tests/t9502-SubstituteTransactionalExprEach-string-split.vim: -------------------------------------------------------------------------------- 1 | " Test replacing all matches in the buffer. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /"foobar\nfoo"/"hihohuppala\nFOOX"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9510-SubstituteTransactionalExprEach-no-matches.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9514-SubstituteTransactionalExprEach-capture-group.ok: -------------------------------------------------------------------------------- 1 | FOO(1, FOO, "FOOXXX", FOOx[1], XXX) && FOO(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! Foo and FOO! 4 | -------------------------------------------------------------------------------- /tests/t9514-SubstituteTransactionalExprEach-capture-group.vim: -------------------------------------------------------------------------------- 1 | " Test using allowed capture groups. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['bar', 'f\(o\+\)']/['XXX', 'FOO']/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9516-SubstituteTransactionalExprEach-magic.ok: -------------------------------------------------------------------------------- 1 | zup(1, zup, "zupbar", zupXXX, bar) && zup(baz, looooony)XXX; 2 | She said, "It's NOT my fault!"?We agreed and shouted "yeah!" 3 | We need more zup! Foo and zup! 4 | -------------------------------------------------------------------------------- /tests/t9516-SubstituteTransactionalExprEach-magic.vim: -------------------------------------------------------------------------------- 1 | " Test changing magic. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\V[1]', '\ 12/19 shouted "[yeah]!" 3 | We [need] [more] 16/19! 17/19 18/19 19/19! 4 | -------------------------------------------------------------------------------- /tests/t9530-SubstituteTransactionalExprEach-context.vim: -------------------------------------------------------------------------------- 1 | " Test replacing matches using the context. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach #['\<...\>', '\<....\>', '\']#["\\=v:val.matchCount . '/' . v:val.matchNum", "\\='[' . v:val.matchText . ']'", "\\='<' . v:val.startPos[1] . '-' . v:val.endPos[1] . '>'"]#g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9540-SubstituteTransactionalExprEach-test-expr-skip.ok: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", 1-FOX[1], 2-BAR) && foo(3-BAZ, looooony)[1]; 2 | 4-SHE said, "It's 5-NOT my fault!". We 6-AGREED 7-AND shouted "yeah!" 3 | We need more foo! 8-FOO 9-AND foo! 4 | -------------------------------------------------------------------------------- /tests/t9540-SubstituteTransactionalExprEach-test-expr-skip.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to skip matches. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\<...\>', '\']/"\\=v:val.matchCount . '-' . toupper(v:val.matchText)"/gt/if submatch(0)=='foo'|throw 'skip'|endif/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9545-SubstituteTransactionalExprEach-test-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | 1-FOO(1, 2-FOO, "foobar", 3-FOX[1], 4-BAR) && 5-FOO(6-BAZ, looooony)[1]; 2 | 7-SHE said, "It's 8-NOT my fault!". We agreed 9-AND shouted "yeah!" 3 | We need more 10-FOO! 11-FOO 12-AND 13-FOO! 4 | -------------------------------------------------------------------------------- /tests/t9550-SubstituteTransactionalExprEach-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | 1-FOO(1, 2-FOO, "foobar", 3-FOX[1], 4-BAR) && 5-FOO(6-BAZ, looooony)[1]; 2 | 7-SHE said, "It's 8-NOT my fault!". We agreed 9-AND shouted "yeah!" 3 | We need more 10-FOO! 12-FOO 14-AND 15-FOO! 4 | -------------------------------------------------------------------------------- /tests/t9550-SubstituteTransactionalExprEach-expr-patternIndex.vim: -------------------------------------------------------------------------------- 1 | " Test using patternIndex within replacement expression. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\%3l\<[Ff]oo\>', '\<...\>']/"\\=v:val.patternIndex == 0 ? v:val.matchText : v:val.matchCount . '-' . toupper(v:val.matchText)"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9552-SubstituteTransactionalExprEach-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | foo<2><1>(1, foo<2><1>, "foobar", fox<2>[1], bar<2>) && foo<2><1>(baz<2>, looooony)[1]; 2 | She<2> said, "It's NOT<2> my fault!". We agreed and<2> shouted "yeah!" 3 | We need more foo<2><1><0>! Foo<2><1> and<2> foo<2><1><0>! 4 | -------------------------------------------------------------------------------- /tests/t9552-SubstituteTransactionalExprEach-expr-patternIndex.vim: -------------------------------------------------------------------------------- 1 | " Test using patternIndex within replacement expression. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\<...\>!\@=', '\<[Ff]oo\>', '\<...\>']/"\\=v:val.matchText . '<' . v:val.patternIndex . '>'"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9554-SubstituteTransactionalExprEach-expr-patternIndex.ok: -------------------------------------------------------------------------------- 1 | {{foo}}(1, {{foo}}, "foobar", {{fox}}[1], {{bar}}) && {{foo}}({{baz}}, looooony)[1]; 2 | {{She}} said, "It's {{NOT}} my fault!". We agreed {{and}} shouted "yeah!" 3 | We need more {{foo}}! {{Foo}} {{and}} {{foo}}! 4 | -------------------------------------------------------------------------------- /tests/t9554-SubstituteTransactionalExprEach-expr-patternIndex.vim: -------------------------------------------------------------------------------- 1 | " Test using patternIndex within replacement expression. 2 | 3 | edit text.txt 4 | let g:chars = ['{{', '}}'] 5 | %SubstituteTransactionalExprEach /['\ze\<...\>', '\<...\>\zs']/"\\=g:chars[v:val.patternIndex]"/g 6 | 7 | call vimtest#SaveOut() 8 | call vimtest#Quit() 9 | -------------------------------------------------------------------------------- /tests/t9555-SubstituteTransactionalExprEach-multiple-replacements.ok: -------------------------------------------------------------------------------- 1 | {{foo}}(1, {{foo}}, "foobar", {{fox}}[1], {{bar}}) && {{foo}}({{baz}}, looooony)[1]; 2 | {{She}} said, "It's {{NOT}} my fault!". We agreed {{and}} shouted "yeah!" 3 | We need more {{foo}}! {{Foo}} {{and}} {{foo}}! 4 | -------------------------------------------------------------------------------- /tests/t9555-SubstituteTransactionalExprEach-multiple-replacements.vim: -------------------------------------------------------------------------------- 1 | " Test using multiple replacements instead of patternIndex. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\ze\<...\>', '\<...\>\zs']/"{{\n}}"/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9560-SubstituteTransactionalExprEach-test-expr-capture.ok: -------------------------------------------------------------------------------- 1 | 8:FOO(1, 8:FOO, "foobar", 8:FOX8:[1], 8:BAR) && 8:FOO(8:BAZ, looooony)8:[1]; 2 | 3:SHE said, "It's 3:NOT my fault!". We agreed 3:AND shouted "yeah!" 3 | We need more 4:FOO! 4:FOO 4:AND 4:FOO! 4 | -------------------------------------------------------------------------------- /tests/t9560-SubstituteTransactionalExprEach-test-expr-capture.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to capture additional information. 2 | 3 | edit text.txt 4 | %SubstituteTransactionalExprEach /['\<...\>', '\[1\]']/"\\=v:val.d[line('.')] . ':' . toupper(v:val.matchText)"/gt/let v:val.d[line('.')] = get(v:val.d, line('.'), 0) + 1/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9570-SubstituteTransactionalExprEach-update-predicate.ok: -------------------------------------------------------------------------------- 1 | (1, , "foobar", <[1]>, ) && (, looooony)<[1]>; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more FOO! FOO AND FOO! 4 | -------------------------------------------------------------------------------- /tests/t9575-SubstituteTransactionalExprEach-test-update-predicate.ok: -------------------------------------------------------------------------------- 1 | YYY(1, YYY, "foobar", YYY[1], YYY) && YYY(YYY, looooony)[1]; 2 | YYY said, "It's YYY my fault!". We agreed YYY shouted "yeah!" 3 | We need more YYY! YYY YYY YYY! 4 | -------------------------------------------------------------------------------- /tests/t9580-SubstituteTransactionalExprEach-repeat.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | -------------------------------------------------------------------------------- /tests/t9585-SubstituteTransactionalExprEach-repeat-flags.ok: -------------------------------------------------------------------------------- 1 | XXX(1, XXX, "foobar", XXX[1], XXX) && XXX(XXX, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more XXX! XXX XXX XXX! 4 | -------------------------------------------------------------------------------- /tests/t9590-SubstituteTransactionalExprEach-api.ok: -------------------------------------------------------------------------------- 1 | ZZZפ(1, ZZZפ, "foobar", ZZZ×[1], ZZZ×) && ZZZפ(ZZZ×, looooony)[1]; 2 | ZZZ× said, "It's ZZZ× my fault!". We agreed ZZZ× shouted "yeah!" 3 | We need more ZZZפ¡! ZZZפ ZZZ× ZZZפ¡! 4 | -------------------------------------------------------------------------------- /tests/t9600-SubstituteRotate.vim: -------------------------------------------------------------------------------- 1 | " Test rotating matches. 2 | 3 | edit enumeration.txt 4 | 1,4SubstituteRotate /\[\w\+\]/1/g 5 | 6 | 7SubstituteRotate /\[\w\+\]/4/g 7 | 8 | 14SubstituteRotate /\[\w\+\]/+2/g 9 | 15SubstituteRotate /\[\w\+\]/-1/g 10 | 16SubstituteRotate /\[\w\+\]/-2/g 11 | 12 | call vimtest#SaveOut() 13 | call vimtest#Quit() 14 | -------------------------------------------------------------------------------- /tests/t9610-SubstituteRotate-no-matches.vim: -------------------------------------------------------------------------------- 1 | " Test error when the pattern doesn't match. 2 | 3 | call vimtest#StartTap() 4 | call vimtap#Plan(1) 5 | 6 | edit enumeration.txt 7 | call vimtap#err#ErrorsLike('^E486: .*: doesNotExist', '%SubstituteRotate /doesNotExist/1/', 'Pattern not found error shown') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/t9650-SubstituteRotate-repeat.vim: -------------------------------------------------------------------------------- 1 | " Test reuse of pattern, shift value, and offset when repeating rotating matches. 2 | 3 | edit enumeration.txt 4 | 1,4SubstituteRotate /\[\w\+\]/2/ 5 | 7,8SubstituteRotate g 6 | 7 | 14SubstituteRotate /\[\w\+\]/-3/g 8 | 15,16SubstituteRotate 9 | 10 | call vimtest#SaveOut() 11 | call vimtest#Quit() 12 | -------------------------------------------------------------------------------- /tests/t9670-SubstituteRotate-test-expr-skip.vim: -------------------------------------------------------------------------------- 1 | " Test using the test expression to skip matches when rotating matches. 2 | 3 | edit enumeration.txt 4 | 1,4SubstituteRotate /\[\w\+\]/1/gt/if submatch(0)=='[three]'|throw 'skip'|endif/ 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9690-SubstituteRotateMemoized.vim: -------------------------------------------------------------------------------- 1 | " Test memoized rotating of matches. 2 | 3 | edit enumeration.txt 4 | %SubstituteRotateMemoized /\[\w\+\]/1/g 5 | 6 | call vimtest#SaveOut() 7 | call vimtest#Quit() 8 | -------------------------------------------------------------------------------- /tests/t9691-SubstituteRotateMemoized-shift.vim: -------------------------------------------------------------------------------- 1 | " Test memoized shifting of matches. 2 | 3 | edit enumeration.txt 4 | call vimtest#StartTap() 5 | call vimtap#Plan(1) 6 | %SubstituteRotateMemoized /\[\w\+\]/[???]/-2/g 7 | call vimtap#Is(@", "[one]\n[two]\n", 'missed first two matches') 8 | 9 | call vimtest#SaveOut() 10 | call vimtest#Quit() 11 | -------------------------------------------------------------------------------- /tests/text.txt: -------------------------------------------------------------------------------- 1 | foo(1, foo, "foobar", fox[1], bar) && foo(baz, looooony)[1]; 2 | She said, "It's NOT my fault!". We agreed and shouted "yeah!" 3 | We need more foo! Foo and foo! 4 | --------------------------------------------------------------------------------