From 22286705a74596d98b2bf200cef47afb3571844e Mon Sep 17 00:00:00 2001 From: John Fremlin VII Date: Tue, 28 May 2013 11:28:14 -0700 Subject: [PATCH] correct broken testcase MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Summary: Turns out that phabricator and arc unit do not actually run tests in our internal repo and this one had a bunch of syntax errors. doh No test cases were changed, just fixing syntax. Test Plan: - fbconfig folly/test - fbmake runtests - saw all ok - _bin/folly/test/json_test [==========] Running 10 tests from 1 test case. [----------] Global test environment set-up. [----------] 10 tests from Json [ RUN ] Json.Unicode [ OK ] Json.Unicode (0 ms) [ RUN ] Json.Parse [ OK ] Json.Parse (1 ms) [ RUN ] Json.JavascriptSafe [ OK ] Json.JavascriptSafe (0 ms) [ RUN ] Json.Produce [ OK ] Json.Produce (0 ms) [ RUN ] Json.JsonEscape [ OK ] Json.JsonEscape (0 ms) [ RUN ] Json.JsonNonAsciiEncoding [ OK ] Json.JsonNonAsciiEncoding (0 ms) [ RUN ] Json.UTF8Retention WARNING: Logging before InitGoogleLogging() is written to STDERR I0528 11:29:43.879976 17977 JsonTest.cpp:257] input: ♥ => json: "♥" I0528 11:29:43.880077 17977 JsonTest.cpp:259] output: ♥ => json: "♥" [ OK ] Json.UTF8Retention (1 ms) [ RUN ] Json.UTF8EncodeNonAsciiRetention I0528 11:29:43.880122 17977 JsonTest.cpp:284] input: ♥ => json: "\u2665" I0528 11:29:43.880131 17977 JsonTest.cpp:286] output: ♥ => json: "\u2665" [ OK ] Json.UTF8EncodeNonAsciiRetention (0 ms) [ RUN ] Json.UTF8Validation [ OK ] Json.UTF8Validation (0 ms) [ RUN ] Json.ParseNonStringKeys [ OK ] Json.ParseNonStringKeys (0 ms) [----------] 10 tests from Json (2 ms total) [----------] Global test environment tear-down [==========] 10 tests from 1 test case ran. (2 ms total) [ PASSED ] 10 tests. Reviewed By: delong.j@fb.com FB internal diff: D826413 Blame Revision: D805218 --- folly/test/JsonTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/folly/test/JsonTest.cpp b/folly/test/JsonTest.cpp index b3165308..ef66acee 100644 --- a/folly/test/JsonTest.cpp +++ b/folly/test/JsonTest.cpp @@ -317,7 +317,7 @@ TEST(Json, UTF8Validation) { TEST(Json, ParseNonStringKeys) { // test string keys - EXPECT_EQ("a", parseJson("{\"a\":[]}").items().begin().first.asString()); + EXPECT_EQ("a", parseJson("{\"a\":[]}").items().begin()->first.asString()); // check that we don't allow non-string keys as this violates the // strict JSON spec (though it is emitted by the output of @@ -329,16 +329,16 @@ TEST(Json, ParseNonStringKeys) { opts.allow_non_string_keys = true; auto val = parseJson("{1:[]}", opts); - EXPECT_EQ(1, val.items().begin().first.asInteger()); + EXPECT_EQ(1, val.items().begin()->first.asInt()); // test we can still read in strings auto sval = parseJson("{\"a\":[]}", opts); - EXPECT_EQ("a", sval.items().begin().first.asString()); + EXPECT_EQ("a", sval.items().begin()->first.asString()); // test we can read in doubles auto dval = parseJson("{1.5:[]}", opts); - EXPECT_EQ(1.5, dval.items().begin().first.asDouble()); + EXPECT_EQ(1.5, dval.items().begin()->first.asDouble()); } BENCHMARK(jsonSerialize, iters) { -- 2.34.1