Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: test/cctest/test-strings.cc

Issue 1087633005: Start migrating error message templates to the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/weak-collection.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 8d5129cd05e50b42338f4079f585c677f9f73bd4..9d397112ee48395d57354e081e4d6c0396e2e8b7 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -36,6 +36,7 @@
#include "src/api.h"
#include "src/factory.h"
+#include "src/messages.h"
#include "src/objects.h"
#include "src/unicode-decoder.h"
#include "test/cctest/cctest.h"
@@ -1459,3 +1460,20 @@ INVALID_STRING_TEST(NewStringFromUtf8, char)
INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
#undef INVALID_STRING_TEST
+
+
+TEST(FormatMessage) {
+ CcTest::InitializeVM();
+ LocalContext context;
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ Handle<String> arg0 = isolate->factory()->NewStringFromAsciiChecked("arg0");
+ Handle<String> arg1 = isolate->factory()->NewStringFromAsciiChecked("arg1");
+ Handle<String> arg2 = isolate->factory()->NewStringFromAsciiChecked("arg2");
+ Handle<String> result =
+ MessageTemplate::FormatMessage(MessageTemplate::kPropertyNotFunction,
+ arg0, arg1, arg2).ToHandleChecked();
+ Handle<String> expected = isolate->factory()->NewStringFromAsciiChecked(
+ "Property 'arg0' of object arg1 is not a function");
+ CHECK(String::Equals(result, expected));
+}
« no previous file with comments | « src/weak-collection.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698