Skip to content

Commit

Permalink
Spec'd multiply
Browse files Browse the repository at this point in the history
  • Loading branch information
matholroyd committed Mar 4, 2012
1 parent 3568a00 commit e6c93d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascript/lyahfgg/chapter-10.js
Expand Up @@ -2,7 +2,9 @@ exports.solveRPN = function(equation) {
var get_operator = function(op) {
switch(op) {
case '+':
return function(a, b) { return a + b; }
return function(a, b) { return a + b; }
case '*':
return function(a, b) { return a * b; }
}
}

Expand Down
5 changes: 5 additions & 0 deletions javascript/lyahfgg/chapter-10.spec.js
Expand Up @@ -4,4 +4,9 @@ describe("Reverse Polish Notation", function() {
it("1 2 + => 3", function() {
expect(chapter10.solveRPN("1 2 +")).toEqual(3);
});

it("2 5 * => 10", function() {
expect(chapter10.solveRPN("2 5 *")).toEqual(10);
});

});

0 comments on commit e6c93d0

Please sign in to comment.