def testgreg5(self): res = parse("1min + 1x(10sec+50sec) + 8 x 1min") assert_equals(len(res),33) assert_equals(res[0],60) assert_equals(res[3],10) assert_equals(res[6],50) assert_equals(res[9],60)
def testgreg5(self): res = parse("1min + 1x(10sec+50sec) + 8 x 1min") assert_equal(len(res), 33) assert_equal(res[0], 60) assert_equal(res[3], 10) assert_equal(res[6], 50) assert_equal(res[9], 60)
def testgreg6(self): res = parse("1min + 2x(10sec+50sec) + 7x1min") assert_equal(len(res), 36) assert_equal(res[0], 60) assert_equal(res[3], 10) assert_equal(res[6], 50) assert_equal(res[9], 10) assert_equal(res[12], 50)
def testgreg3(self): res = parse("1min + 9 x (10sec + 50 sec)") assert_equal(len(res), 57) assert_equal(res[0], 60) assert_equal(res[3], 10) assert_equal(res[6], 50) assert_equal(res[9], 10) assert_equal(res[12], 50)
def testgreg6(self): res = parse("1min + 2x(10sec+50sec) + 7x1min") assert_equals(len(res),36) assert_equals(res[0],60) assert_equals(res[3],10) assert_equals(res[6],50) assert_equals(res[9],10) assert_equals(res[12],50)
def testgreg3(self): res = parse("1min + 9 x (10sec + 50 sec)") assert_equals(len(res),57) assert_equals(res[0],60) assert_equals(res[3],10) assert_equals(res[6],50) assert_equals(res[9],10) assert_equals(res[12],50)
def test8x500m(self): res = parse("8x500m/2min") assert_equal(len(res), 48) assert_equal(res[0], 500) assert_equal(res[1], 'meters') assert_equal(res[2], 'work') assert_equal(res[3], 120) assert_equal(res[4], 'seconds') assert_equal(res[5], 'rest')
def testgreg2(self): res = parse("3x((1000m+750m+500m+250m)/0m)+2500m") assert_equal(len(res), 48) assert_equal(res[0], 1000) assert_equal(res[1], 'meters') assert_equal(res[2], 'work') assert_equal(res[3], 750) assert_equal(res[4], 'meters') assert_equal(res[5], 'work')
def testtwokonoff(self): res = parse("2x500m/500m") assert_equal(len(res), 12) assert_equal(res[0], 500) assert_equal(res[1], 'meters') assert_equal(res[2], 'work') assert_equal(res[3], 500) assert_equal(res[4], 'meters') assert_equal(res[5], 'rest')
def testsixmins(self): res = parse("6min/4min+5min/3min+3min/3min+3min") assert_equal(len(res), 21) assert_equal(res[0], 360) assert_equal(res[1], 'seconds') assert_equal(res[2], 'work') assert_equal(res[3], 240) assert_equal(res[4], 'seconds') assert_equal(res[5], 'rest')
def testsixmins(self): res=parse("6min/4min+5min/3min+3min/3min+3min") assert_equals(len(res),21) assert_equals(res[0],360) assert_equals(res[1],'seconds') assert_equals(res[2],'work') assert_equals(res[3],240) assert_equals(res[4],'seconds') assert_equals(res[5],'rest')
def testgreg2(self): res=parse("3x((1000m+750m+500m+250m)/0m)+2500m") assert_equals(len(res),48) assert_equals(res[0],1000) assert_equals(res[1],'meters') assert_equals(res[2],'work') assert_equals(res[3],750) assert_equals(res[4],'meters') assert_equals(res[5],'work')
def test8x500m(self): res=parse("8x500m/2min") assert_equals(len(res),48) assert_equals(res[0],500) assert_equals(res[1],'meters') assert_equals(res[2],'work') assert_equals(res[3],120) assert_equals(res[4],'seconds') assert_equals(res[5],'rest')
def testtwokonoff(self): res=parse("2x500m/500m") assert_equals(len(res),12) assert_equals(res[0],500) assert_equals(res[1],'meters') assert_equals(res[2],'work') assert_equals(res[3],500) assert_equals(res[4],'meters') assert_equals(res[5],'rest')
def testfourtimes1km(self): res = parse("4x((500m+500m)/5min)") assert_equal(len(res), 36) assert_equal(res[0], 500) assert_equal(res[1], 'meters') assert_equal(res[2], 'work') assert_equal(res[3], 500) assert_equal(res[4], 'meters') assert_equal(res[5], 'work') assert_equal(res[6], 300) assert_equal(res[7], 'seconds') assert_equal(res[8], 'rest')
def testfourtimes1km(self): res=parse("4x((500m+500m)/5min)") assert_equals(len(res),36) assert_equals(res[0],500) assert_equals(res[1],'meters') assert_equals(res[2],'work') assert_equals(res[3],500) assert_equals(res[4],'meters') assert_equals(res[5],'work') assert_equals(res[6],300) assert_equals(res[7],'seconds') assert_equals(res[8],'rest')
def test10km(self): res = parse("10km") assert_equal(len(res), 3) assert_equal(res[0], 1e4) assert_equal(res[1], 'meters') assert_equal(res[2], 'work')
def test10km(self): res=parse("10km") assert_equals(len(res),3) assert_equals(res[0],1e4) assert_equals(res[1],'meters') assert_equals(res[2],'work')