Skip to content

Instantly share code, notes, and snippets.

@nazgob
Created October 15, 2010 22:44
Show Gist options
  • Save nazgob/629098 to your computer and use it in GitHub Desktop.
Save nazgob/629098 to your computer and use it in GitHub Desktop.
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