From 7faa999deb28b9d417186232cfbfa496f5eb6990 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jul 2019 11:44:09 -0500 Subject: [PATCH] add test --- test/specs/redos/link_code.html | 1 + test/specs/redos/link_code.md | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 test/specs/redos/link_code.html create mode 100644 test/specs/redos/link_code.md diff --git a/test/specs/redos/link_code.html b/test/specs/redos/link_code.html new file mode 100644 index 0000000000..f936665d20 --- /dev/null +++ b/test/specs/redos/link_code.html @@ -0,0 +1 @@ +

INDEX(string, pattern[, start): searches for the first occurrence of pattern in string, starting from start:INDEX("123123", "23", 3)==5INSERT(new, old[, start][, length][, pad]): inserts the new string into the old string after the specified position (default is 0), new string is truncated or padded (default is " ") to the specified length, if start is beyond the end of old old will be paddedLASTPOS(pattern, string[, start]): searches backwards for the last occurrence of pattern in string, starting from start:LASTPOS("123123", "23", 4)==2LINES(file): returns the number of lines typed ahead at the interactive stream:push("a line"); push("second line"); lines(STDIN); /* == 2 */MAX(number, number[, number,...]): obviousMIN(number, number[, number,...]): obviousOPEN(filehandle, filename[, "APPEND"|"READ"|"WRITE"]): opens file, returns boolean for success:OPEN("MyCon", "CON:160/50/320/100/MyCon/CDS")==1OVERLAY(new, old[, start][, length][, pad]): overlays new string onto old one at start for length chars padding with pad if necessary:OVERLAY("4", "123", 5, 5)=="123-4----"POS(pattern, string[, start])` : same as index

diff --git a/test/specs/redos/link_code.md b/test/specs/redos/link_code.md new file mode 100644 index 0000000000..4e9298a5f8 --- /dev/null +++ b/test/specs/redos/link_code.md @@ -0,0 +1,9 @@ +INDEX(string, pattern[, start)` : searches for the first occurrence of pattern in string, starting from start: `INDEX("123123", "23", 3)` == `5` +`INSERT(new, old[, start][, length][, pad])` : inserts the new string into the old string after the specified position (default is 0), new string is truncated or padded (default is " ") to the specified length, if start is beyond the end of old old will be padded +`LASTPOS(pattern, string[, start])` : searches backwards for the last occurrence of pattern in string, starting from start: `LASTPOS("123123", "23", 4)` == `2` +`LINES(file)` : returns the number of lines typed ahead at the interactive stream: `push("a line"); push("second line"); lines(STDIN); /* == 2 */` +`MAX(number, number[, number,...])` : obvious +`MIN(number, number[, number,...])` : obvious +`OPEN(filehandle, filename[, "APPEND"|"READ"|"WRITE"])` : opens file, returns boolean for success: `OPEN("MyCon", "CON:160/50/320/100/MyCon/CDS")` == `1` +`OVERLAY(new, old[, start][, length][, pad])` : overlays new string onto old one at start for length chars padding with pad if necessary: `OVERLAY("4", "123", 5, 5)` == `"123-4----"` +`POS(pattern, string[, start])` : same as index