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

Side by Side Diff: tools/gn/command_format_unittest.cc

Issue 588813002: gn: beginnings of format command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle line comments at eof Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « tools/gn/command_format.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/files/file_util.h"
6 #include "base/strings/string_util.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "tools/gn/commands.h"
9
10 namespace commands {
11 bool FormatFileToString(const std::string& input_filename, std::string* output);
12 } // namespace commands
13
14 TEST(Format, AllTests) {
15 std::string out;
16 std::string expected;
17 for (int i = 1; i <= 3; ++i) {
18 char buf[256];
19 base::snprintf(buf, sizeof(buf), "//tools/gn/format_test_data/%03d.gn", i);
20 EXPECT_TRUE(commands::FormatFileToString(buf, &out));
21 base::FilePath golden;
22 base::snprintf(
23 buf, sizeof(buf), "tools/gn/format_test_data/%03d.golden", i);
24 golden = golden.AppendASCII(buf);
25 ASSERT_TRUE(base::ReadFileToString(golden, &expected));
26 EXPECT_EQ(out, expected);
27 }
28 }
OLDNEW
« no previous file with comments | « tools/gn/command_format.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698