Skip to content

Commit

Permalink
Merge pull request #11 from RedFT/rounding_tests
Browse files Browse the repository at this point in the history
Rounding tests
  • Loading branch information
RedFT authored Apr 7, 2019
2 parents 14987fc + be003b5 commit dad8dbe
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/test_rounding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import numpy as np
import hexy as hx

def test_cube_round():
test_coords = np.array([
[1.1, -1.4, 0.3],
[3.3, 2.3, -5.4],
]);

expected_coords = np.array([
[1, -1, 0],
[3, 2, -5],
]);

assert(np.array_equal(hx.cube_round(test_coords), expected_coords))

def test_axial_round():
test_coords = np.array([
[1.1, -1.4],
[3.3, 2.3],
]);

expected_coords = np.array([
[1, -1],
[3, 2],
]);

assert(np.array_equal(hx.axial_round(test_coords), expected_coords))

0 comments on commit dad8dbe

Please sign in to comment.