Created
October 15, 2010 22:44
-
-
Save nazgob/629098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_F(SExpTest, SExpWithOperator) | |
{ | |
// (2 3) | |
SExp* valuePair = new SExp(a, b); | |
// (+, (2 3)) = 5 | |
SExp* addOpWithValue = new SExp(new AddOperator(), valuePair); | |
EXPECT_EQ(5, addOpWithValue->Evaluate(context)); | |
delete addOpWithValue; | |
// (-, (2 3)) = -1 | |
SExp* subOpWithValue = new SExp(new SubOperator(), valuePair); | |
EXPECT_EQ(-1, subOpWithValue->Evaluate(context)); | |
delete subOpWithValue; | |
delete valuePair; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment