Skip to content

Commit

Permalink
add specific tests for negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker committed Mar 22, 2022
1 parent 8215f7d commit b2a00d6
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -115,4 +115,20 @@ void testWorldPosParsing() {
BlockNBTComponent.Pos.fromString("12 ~3 1200")
);
}

@Test
void testLocalPosParsingWithNegatives() {
assertEquals(
BlockNBTComponent.LocalPos.localPos(-4.5, 3, -35.67),
BlockNBTComponent.Pos.fromString("^-4.5 ^3 ^-35.67")
);
}

@Test
void testWorldPosParsingWithNegatives() {
assertEquals(
BlockNBTComponent.WorldPos.worldPos(BlockNBTComponent.WorldPos.Coordinate.relative(-6), BlockNBTComponent.WorldPos.Coordinate.absolute(-34), BlockNBTComponent.WorldPos.Coordinate.relative(13)),
BlockNBTComponent.Pos.fromString("~-6 -34 ~13")
);
}
}

0 comments on commit b2a00d6

Please sign in to comment.