From 80ca67c33323b61f0e2f930c7a77ffa160f9ffd1 Mon Sep 17 00:00:00 2001 From: Gravifer <44160838+Gravifer@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:36:40 +0800 Subject: [PATCH] fix(lab11): normalize line endings in `BinaryTreeTest.binaryTreeConstructorTest()` assertion `BinaryTree.print()` respects OS defined newline, which should be normalized in the test. --- lab11/tests/BinaryTreeTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lab11/tests/BinaryTreeTest.java b/lab11/tests/BinaryTreeTest.java index 38eeb02..bc49195 100644 --- a/lab11/tests/BinaryTreeTest.java +++ b/lab11/tests/BinaryTreeTest.java @@ -91,8 +91,8 @@ public void binaryTreeConstructorTest() { System.setOut(oldOut); assertWithMessage("The preorder and/or inorder traversals for the given BinarySearchTree are incorrect") - .that(outContent.toString().trim()) - .isEqualTo("x in preorder\nA B C D E F \nx in inorder\nB A E D F C \n\n".trim()); + .that(outContent.toString().trim().replace("\r\n", "\n")) + .isEqualTo("x in preorder\nA B C D E F \nx in inorder\nB A E D F C \n\n".trim()); } -} \ No newline at end of file +}