| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include "nacl_mounts/kernel_proxy.h" | 7 #include "nacl_mounts/kernel_proxy.h" |
| 8 #include "nacl_mounts/path.h" | 8 #include "nacl_mounts/path.h" |
| 9 | 9 |
| 10 #include "gtest/gtest.h" | 10 #include "gtest/gtest.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 EXPECT_EQ(".", test.Join()); | 235 EXPECT_EQ(".", test.Join()); |
| 236 | 236 |
| 237 test = relative; | 237 test = relative; |
| 238 test.Append("../../.."); | 238 test.Append("../../.."); |
| 239 EXPECT_EQ("..", test.Join()); | 239 EXPECT_EQ("..", test.Join()); |
| 240 | 240 |
| 241 test = relative; | 241 test = relative; |
| 242 test.Append("../../../foo"); | 242 test.Append("../../../foo"); |
| 243 EXPECT_EQ("../foo", test.Join()); | 243 EXPECT_EQ("../foo", test.Join()); |
| 244 } | 244 } |
| 245 |
| 246 TEST(PathTest, Range) { |
| 247 Path p("/an/absolute/path"); |
| 248 |
| 249 // p's parts should be ["/", "an", "absolute", "path"]. |
| 250 EXPECT_EQ("/an/absolute/path", p.Range(0, 4)); |
| 251 EXPECT_EQ("an/absolute/path", p.Range(1, 4)); |
| 252 EXPECT_EQ("absolute/path", p.Range(2, 4)); |
| 253 EXPECT_EQ("path", p.Range(3, 4)); |
| 254 |
| 255 EXPECT_EQ("/an/absolute", p.Range(0, 3)); |
| 256 EXPECT_EQ("an/absolute", p.Range(1, 3)); |
| 257 EXPECT_EQ("absolute", p.Range(2, 3)); |
| 258 } |
| OLD | NEW |