Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public MigrateToV2(@Nullable String recipe, String delimiter) {
}

public MigrateToV2(String recipe) {
this(recipe, "\n");
this(recipe, "\\r?\\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen recipes with \r\n in the past and they seemed to work. Were only some directives stripping the \r or something?

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ public void testComplexExpression() throws Exception {
"send-to-error body_5 =~ \"DC.*\"",
"filter-rows-on regex-match body_5 *as*"
};
CompileStatus compile = TestingRig.compile(recipe);
Assert.assertTrue(true);
TestingRig.compileSuccess(recipe);
}

@Test
Expand All @@ -183,26 +182,31 @@ public void test() throws Exception {
"send-to-error body_5 =~ \"DC.*\"",
"filter-rows-on regex-match body_5 *as*"
};
CompileStatus compile = TestingRig.compile(recipe);
Assert.assertTrue(true);
TestingRig.compileSuccess(recipe);
}

@Test
public void testSingleLineDirectives() throws Exception {
String[] recipe = new String[] {
"parse-as-csv :body '\t' true; drop :body;"
};
CompileStatus compile = TestingRig.compile(recipe);
Assert.assertTrue(true);
TestingRig.compileSuccess(recipe);
}

@Test
public void testHandlingCRLF() throws Exception {
String[] recipe = new String[] {
"parse-as-csv :body '\t' true;\r\ndrop :body;\r\n"
};
TestingRig.compileSuccess(recipe);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't just test that it compiles (didn't it compile successfully before?) Should test that the directives are parsed into the exact strings that are expected.

}

@Test
public void testError() throws Exception {
String[] recipe = new String[] {
"parse-as-abababa-csv :body '\t' true; drop :body;"
};
CompileStatus compile = TestingRig.compile(recipe);
Assert.assertTrue(true);
TestingRig.compileSuccess(recipe);
}

@Test
Expand Down