Skip to content

Commit b5761ce

Browse files
committed
hotfix: Enable (0,0) copy instructions.
1 parent fa485f7 commit b5761ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

util/src/main/java/diffr/util/instruction/InstructionParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
*/
1414
public class InstructionParser {
1515

16-
public static final String COPY_REGEX = "[1-9]\\d*,[1-9]\\d*",
16+
public static final String NUMBER_REGEX = "(0|([1-9]\\d*))",
17+
COPY_REGEX = NUMBER_REGEX + "," + NUMBER_REGEX,
1718
INSERT_REGEX = "> [\\S\\s]*";
1819

1920
/**

util/src/test/java/diffr/util/instruction/InstructionParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class InstructionParserTest {
1919
"> 1245oweifhwoeijoij//fwefwgtwgt", "> \n\n\n\n"};
2020
public static final String[] falseInsertExamples = {">hello", ">\t\n", ">\n", "><",
2121
">>", ">", " >", "hello", "123\n", "\t> hello"};
22-
public static final String[] trueCopyExamples = {"5,41", "50,425", "234565,2344000"};
22+
public static final String[] trueCopyExamples = {"5,41", "50,425", "234565,2344000", "0,0"};
2323
public static final String[] falseCopyExamples = {"05,4", "5f,4", ",0", ",",
2424
"0,", "hello sir!", " 3,4", "4,2 ", "4, 2", "4 ,2"};
2525

0 commit comments

Comments
 (0)