I am implementing the Shunting Yard algorithm and would like to ask for some test cases.
Basically I would like those that have implemented the algorithm to share the cases that made them have to go back and adjust their code.
Would this get closed?
Is getting/generating test cases a(n interesting) computer science problem or are you "only lazy" (no offense intended, being lazy is a legitimate strategy)?
Fair question, no offense taken.
One of the reasons I asked about it here first is so that we can set a standard for asking for test cases. It might open a new set of questions for the CS:StackExchange site and get more users in here and more different questions; NP and grammar problems are getting boring.
Some of the test I have are
5-3-1 : is (5-3)-1 and not 5-(3-1) to test left associativity 2^3^4 : is 2^(3^4) and not (2^3)^4 to test right associativity. 1 : has no operator to test if that will pass through without error. -1 : is the simplest test of a prefix unary operator. (1) : is the simplest test with parens and no operators. 0! : is the simplest test of a postfix unary operator. -(3-1) : the unary - has to be applied as a different operator, i.e. in postfix notation: 31--. (3-1)! : the expression has to be evaluated before applying the factorial operator. ((4-(3-(2-1)))) : to test the shunting yard.