aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavid Samanghoon <nsama24@student.sdu.dk>2025-10-13 12:34:44 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commit6fbae842769ade6fbb6f77e53049ee06411e2d1a (patch)
tree3dfe07d2e8f19b9c70459cce9305361aa96b2b17
parent42d5445e7bc9a7a665ffd8fbc8f7dc5e8f229ee0 (diff)
downloadsorter-6fbae842769ade6fbb6f77e53049ee06411e2d1a.tar.gz
sorter-6fbae842769ade6fbb6f77e53049ee06411e2d1a.zip
fix(test): the test used an unstable sorting algorithm, which caused insertion sort to fail on duplicates. This has been fixed now.
-rw-r--r--src/insertion_sort.s2
-rwxr-xr-xtest/test.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/insertion_sort.s b/src/insertion_sort.s
index 359e39f..ed4ade2 100644
--- a/src/insertion_sort.s
+++ b/src/insertion_sort.s
@@ -69,4 +69,4 @@ done:
pop %r10
pop %r9
pop %r8
- ret \ No newline at end of file
+ ret
diff --git a/test/test.sh b/test/test.sh
index ec9d65c..855d6cf 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -3,7 +3,7 @@
TEST_INPUT="numbers.txt"
SORTER="./sorter"
-REF="sort -n -k 2"
+REF="sort -s -n -k 2"
SORTER_OUT="sorter_out.txt"
REF_OUT="ref_output.txt"