Skip to content

Commit

Permalink
Improved some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Sep 22, 2024
1 parent 9909809 commit 82c9844
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.usethesource.vallang.basic;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

Expand Down Expand Up @@ -92,11 +94,11 @@ public void testEquals(IValueFactory vf) {
IString y = vf.string("abcdefgh");
IString z = vf.string("abcdefgi");

assertTrue(x.hashCode() == y.hashCode());
assertTrue(x.equals(y));
assertTrue(y.equals(x));
assertTrue(!z.equals(x));
assertTrue(x.substring(0, 0).equals(vf.string("")));
assertEquals(x.hashCode(), y.hashCode());
assertEquals(x, y);
assertEquals(y, x);
assertNotEquals(z, x);
assertEquals(x.substring(0, 0), vf.string(""));
} finally {
StringValue.resetMaxFlatString();
StringValue.resetMaxUnbalance();
Expand Down

0 comments on commit 82c9844

Please sign in to comment.