forked from robotika/eduro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfre_test.py
More file actions
24 lines (12 loc) · 779 Bytes
/
fre_test.py
File metadata and controls
24 lines (12 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
import unittest
import math
from fre import *
class FRETest( unittest.TestCase ):
def testSplitScan( self ):
self.assertEqual( splitScan( [509, 3193, 2401, 1936, 1632, 1420, 1265, 1149, 1059, 990, 1804, 1723, 1661, 2392, 3108, 1000000, 1000000, 1000000], rowsOnLeft=False ), [[1936, 1632, 1420, 1265, 1149, 1059, 990], [1804, 1723, 1661]] )
self.assertEqual( splitScan( [1000000, 1000000, 1000000, 1000000, 1000000, 2372, 1639, 1701, 1781, 965, 1033, 1120, 1234, 1385, 1591, 1888, 2342, 3114], rowsOnLeft=True), [[1639, 1701, 1781], [965, 1033, 1120, 1234, 1385, 1591, 1888]])
def testPerpDist( self ):
self.assertAlmostEqual( perpDist(1.41, 1.41, math.radians(90)), 1.0, 2 )
if __name__ == "__main__":
unittest.main()