Mercurial Hosting > traffic-intelligence
diff python/tests/utils.txt @ 31:c000f37c316d
moved tests to independent file, added chi2 computation
author | Nicolas Saunier <nico@confins.net> |
---|---|
date | Sat, 13 Feb 2010 19:46:33 -0500 |
parents | |
children | 48e56179c39e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/tests/utils.txt Sat Feb 13 19:46:33 2010 -0500 @@ -0,0 +1,23 @@ +>>> from utils import * +>>> from moving import Point + +>>> computeChi2([],[]) +0.0 +>>> computeChi2(range(1,10),range(1,10)) +0.0 +>>> computeChi2(range(1,9),range(1,10)) +0.0 + +>>> segmentIntersection(Point(0,0),Point(1,1), Point(0,1), Point(1,2)) +>>> segmentIntersection(Point(0,1),Point(1,0), Point(0,2), Point(2,1)) +>>> segmentIntersection(Point(0,0),Point(2,0), Point(1,-1),Point(1,1)) +(1.000000,0.000000) +>>> segmentIntersection(Point(0,1),Point(2,0),Point(1,1),Point(1,2)) + +>>> f = openCheck('non_existant_file.txt') +File non_existant_file.txt could not be opened. + +>>> removeExtension('test-adfasdf.asdfa.txt') +'test-adfasdf.asdfa' +>>> removeExtension('test-adfasdf') +'test-adfasdf'