Skip to content

Latest commit

 

History

History
71 lines (64 loc) · 1.26 KB

hometask-testcases.md

File metadata and controls

71 lines (64 loc) · 1.26 KB

Test cases for claculator implementation

Unary operators

  • "-13"
  • "6-(-13)"
  • "1---1"
  • "-+---+-1"

Operation priority

  • "1+2*2"
  • "1+(2+3*2)*3"
  • "10*(2+1)"
  • "10**(2+1)"
  • "100/3**2"
  • "100/3%2**2"

Functions and constants

  • "pi+e"
  • "log(e)"
  • "sin(pi/2)"
  • "log10(100)"
  • "sin(pi/2)1116"
  • "2*sin(pi/2)"

Associative

  • "102%12%7"
  • "100/4/3"
  • "2**3**4"

Comparison operators

  • "1+23==1+23"
  • "e**5>=e**5+1"
  • "1+24/3+1!=1+24/3+2"

Common tests

  • "(100)"
  • "666"
  • "10(2+1)"
  • "-.1"
  • "1/3"
  • "1.0/3.0"
  • ".1 * 2.0**56.0"
  • "e**34"
  • "(2.0**(pi/pi+e/e+2.0**0.0))"
  • "(2.0**(pi/pi+e/e+2.0**0.0))**(1.0/3.0)"
  • "sin(pi/2**1) + log(1*4+2**2+1, 3**2)"
  • "10e^0log10(.4* -5/ -0.1-10) - -abs(-53/10) + -5"
  • "sin(-cos(-sin(3.0)-cos(-sin(-3.0*5.0)-sin(cos(log10(43.0))))+cos(sin(sin(34.0-2.0**2.0))))--cos(1.0)--cos(0.0)**3.0)"
  • "2.0**(2.0**2.0*2.0**2.0)"
  • "sin(e**log(e**e**sin(23.0),45.0) + cos(3.0+log10(e**-e)))"

Error cases

  • ""
  • "+"
  • "1-"
  • "1 2"
  • "ee"
  • "123e"
  • "==7"
  • "1 * * 2"
  • "1 + 2(3 * 4))"
  • "((1+2)"
  • "1 + 1 2 3 4 5 6 "
  • "log100(100)"
  • "------"
  • "5 > = 6"
  • "5 / / 6"
  • "6 < = 6"
  • "6 * * 6"
  • "((((("