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