Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / test / sprtTests.cpp
diff options
context:
space:
mode:
Commit4fca8e8e6c1056aed11437c87e9175232b48c8f4 (patch)
Author
 dtrendafilov <trendafilov.dn@gmail.com>
2018-11-22 16:04:22 +0200
Committer
 GitHub <noreply@github.com>
2018-11-22 16:04:22 +0200
Filesbda85506ae253afd73d3ab36d3685b4e5bae3847 /JSImpl/test/sprtTests.cpp
IPL-4fca8e8e6c1056aed11437c87e9175232b48c8f4.tar
IPL-4fca8e8e6c1056aed11437c87e9175232b48c8f4.tar.gz
IPL-4fca8e8e6c1056aed11437c87e9175232b48c8f4.zip
Parent75faff8b35b8f9bfa0a00b973e9323c1dc4c614e (diff)
Parentddc50fe944df0a33386a3213c8021f07ac8ffdd9 (diff)
Merge pull request #62 from SofiaCPP/feature/double
Feature/double
1 files changed, 19 insertions, 19 deletions
-rw-r--r--JSImpl/test/sprtTests.cpp38
diff --git a/JSImpl/test/sprtTests.cpp b/JSImpl/test/sprtTests.cpp
index eef7147..8480554 100644
--- a/JSImpl/test/sprtTests.cpp
+++ b/JSImpl/test/sprtTests.cpp
@@ -81,7 +81,7 @@ TEST_F(SPRTTest, Div)
};
Run(bytecode, sizeof(bytecode));
- ASSERT_EQ(Output.str(), "0");
+ ASSERT_EQ(Output.str(), "0.857143");
}
TEST_F(SPRTTest, Mod)
@@ -235,24 +235,24 @@ TEST_F(SPRTTest, Read)
TEST_F(SPASMTest, RSyntax)
{
const char* program =
- "push 5" "\n"
- "const r1 0" "\n"
- "const r2 6" "\n"
- "const r3 7" "\n"
- "const r4 2" "\n"
- "pushr r3" "\n"
- "pushr r2" "\n"
- "pushr r4" "\n"
- "call mult" "\n"
- "popr r1" "\n"
- "print r1" "\n"
- "halt" "\n"
- "label mult" "\n"
- "print a0" "\n"
- "print a1" "\n"
- "print a2" "\n"
- "mul r1 a2 a1" "\n"
- "ret r1" "\n"
+ "00: push 5" "\n"
+ "01: const r1 0" "\n"
+ "02: const r2 6" "\n"
+ "03: const r3 7" "\n"
+ "04: const r4 2" "\n"
+ "05: pushr r3" "\n"
+ "06: pushr r2" "\n"
+ "07: pushr r4" "\n"
+ "08: call mult # *" "\n"
+ "09: popr r1" "\n"
+ "10: print r1" "\n"
+ "11: halt" "\n"
+ "12: label mult" "\n"
+ "13: print a0" "\n"
+ "14: print a1" "\n"
+ "15: print a2" "\n"
+ "16: mul r1 a2 a1" "\n"
+ "17: ret r1" "\n"
""
;
CompileAndRun(program);