• nick's avatar
    base/test/launcher: Don't trim leading whitespace from test output · 0fbbee21
    nick authored
    base/strings: Remove an unnecessary UTF8 check from one of the trim functions
    
    gtest's message often use leading whitespace in a way that's visually meaningful. Some examples:
    
    ======== EXPECT_EQ(this, this+1);
    my_test.cc(2048): error: Value of: this+1
      Actual: 24F8B8D4
    Expected: this
    Which is: 24F8B8A0
    ========
    ======== EXPECT_EQ("AA\nBB\nDD", std::string("AA\nXX\nDD"));
    my_test.cc(2049): error: Value of: std::string("AA\nXX\nDD")
      Actual: "AA\nXX\nDD"
    Expected: "AA\nBB\nDD"
    With diff:
    @@ -1,3 +1,3 @@
     AA
    -BB
    +XX
     DD
    ========
    
    Today leading whitespaces are stripped out by the test launcher, leading to less readable test stdout on the bots (and headaches, especially, if the 'AA' value in the example above had leading whitespace itself -- which is how I noticed this).
    
    The current whitespace trimming seems to be an accidental effect of [https://codereview.chromium.org/324893004], so it should be safe to change back.
    
    BUG=475265
    
    Review URL: https://codereview.chromium.org/1081493002
    
    Cr-Commit-Position: refs/heads/master@{#325512}
    0fbbee21
string_split.cc 5.96 KB