Skip to content

Commit

Permalink
cleanup unitest for co/json
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed May 28, 2021
1 parent 90a32d6 commit 479afac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions unitest/json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ DEF_test(json) {
EXPECT_EQ(s.str(), "\"hello world\"");
EXPECT_EQ(s.pretty(), "\"hello world\"");

s = fastring(300, 'x').append('\n').append(299, 'x');
s = fastring(30, 'x').append('\n').append(500, 'x');
EXPECT(s.is_string());
EXPECT_EQ(s.size(), 600);
EXPECT_EQ(s.str(), fastring("\"").append(300, 'x').append("\\n").append(299, 'x').append('"'));
EXPECT_EQ(s.dbg(), fastring("\"").append(300, 'x').append("\\n").append(211, 'x').append(3, '.').append('"'));
EXPECT_EQ(s.size(), 531);
EXPECT_EQ(s.str(), fastring("\"").append(30, 'x').append("\\n").append(500, 'x').append('"'));
EXPECT_EQ(s.dbg(), fastring("\"").append(30, 'x').append("\\n").append(1, 'x').append(3, '.').append('"'));

s = fastring(600, 'x');
EXPECT_EQ(s.str(), fastring("\"").append(600, 'x').append('"'));
EXPECT_EQ(s.dbg(), fastring("\"").append(512, 'x').append(3, '.').append('"'));
EXPECT_EQ(s.dbg(), fastring("\"").append(32, 'x').append(3, '.').append('"'));

s = fastring("hello world");
EXPECT(s.is_string());
Expand Down

0 comments on commit 479afac

Please sign in to comment.