Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests #1591

Merged
merged 4 commits into from
Sep 30, 2019
Merged
Changes from 1 commit
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 @@ -46,7 +46,7 @@ public class DetectIT {
private static final String OUTPUT_PREFIX = "OCR_PDF_TEST_OUTPUT_" + UUID.randomUUID().toString();

@Before
public void setUp() throws IOException {
public void setUp() {
bout = new ByteArrayOutputStream();
out = new PrintStream(bout);
System.setOut(out);
Expand Down Expand Up @@ -312,8 +312,8 @@ public void testCropHints() throws Exception {
// Assert
String got = bout.toString();
assertThat(got).contains("vertices {");
assertThat(got).contains("x: 599");
assertThat(got).contains("y: 475");
assertThat(got).contains("x: 2"); // Assert in the 200 range
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to consider using a regex here instead:

assertThat("FooBarBaz", matchesPattern("^Foo"));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea! Let me do that. I always forget about regex.

assertThat(got).contains("y: 4"); // Assert in the 400 range
}

@Test
Expand All @@ -325,8 +325,8 @@ public void testCropHintsGcs() throws Exception {
// Assert
String got = bout.toString();
assertThat(got).contains("vertices {");
assertThat(got).contains("x: 599");
assertThat(got).contains("y: 475");
assertThat(got).contains("x: 2"); // Assert in the 200 range
assertThat(got).contains("y: 4"); // Assert in the 400 range
}

@Test
Expand Down