Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/JsEngine.cpp

Issue 9616008: Handle compile time exceptions (Closed)
Patch Set: Created March 6, 2013, 3:17 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/JsEngine.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/JsEngine.cpp
===================================================================
--- a/test/JsEngine.cpp
+++ b/test/JsEngine.cpp
@@ -72,10 +72,18 @@
ASSERT_ANY_THROW(jsEngine.Load("hello.js"));
}
-TEST(JsEngineTest, JsExceptionIsThrown)
+TEST(JsEngineTest, RuntimeExceptionIsThrown)
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
ASSERT_THROW(jsEngine.Evaluate("doesnotexist()"), AdblockPlus::JsError);
}
+
+TEST(JsEngineTest, CompileTimeExceptionIsThrown)
+{
+ ThrowingFileReader fileReader;
+ ThrowingErrorCallback errorCallback;
+ AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback);
+ ASSERT_THROW(jsEngine.Evaluate("'foo'bar'"), AdblockPlus::JsError);
+}
« no previous file with comments | « src/JsEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld