1 // Copyright 2015 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.
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/source_file.h"
8 // The SourceFile object should normalize the input passed to the constructor.
9 // The normalizer unit test checks for all the weird edge cases for normalizing
10 // so here just check that it gets called.
11 TEST(SourceFile
, Normalize
) {
12 SourceFile
a("//foo/../bar.cc");
13 EXPECT_EQ("//bar.cc", a
.value());
15 std::string
b_str("//foo/././../bar.cc");
16 SourceFile
b(SourceFile::SwapIn(), &b_str
);
17 EXPECT_TRUE(b_str
.empty()); // Should have been swapped in.
18 EXPECT_EQ("//bar.cc", b
.value());