diff options
author | 2016-09-14 09:07:53 -0800 | |
---|---|---|
committer | 2016-09-14 10:22:05 -0700 | |
commit | 857fc259445fbff9a23ba1723d7f617ff40fbf05 (patch) | |
tree | 91fd4ac2e3cf08c172abc2e298a9aedf95dcf615 /tensorflow/core/platform/env_test.cc | |
parent | 7794f94cbe28db421a27afac95bfc780fd10be4d (diff) |
Adding io::CleanPath in path.h to clean up paths. Also made TranslateName call CleanPath so that all paths are clean before doing file system ops.
Change: 133140241
Diffstat (limited to 'tensorflow/core/platform/env_test.cc')
-rw-r--r-- | tensorflow/core/platform/env_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/platform/env_test.cc b/tensorflow/core/platform/env_test.cc index 4aea9e9913..4fe1d7d8f7 100644 --- a/tensorflow/core/platform/env_test.cc +++ b/tensorflow/core/platform/env_test.cc @@ -40,7 +40,7 @@ TEST(EnvTest, ReadFileToString) { const string dir = testing::TmpDir(); for (const int length : {0, 1, 1212, 2553, 4928, 8196, 9000, (1 << 20) - 1, 1 << 20, (1 << 20) + 1}) { - const string filename = io::JoinPath(dir, strings::StrCat("file", length)); + const string filename = strings::StrCat(dir, "/bar/..//file", length); // Write a file with the given length const string input = CreateTestFile(env, filename, length); @@ -130,7 +130,7 @@ TEST(EnvTest, DeleteRecursivelyFail) { TEST(EnvTest, RecursivelyCreateDir) { Env* env = Env::Default(); - const string create_path = io::JoinPath(testing::TmpDir(), "a/b/c/d"); + const string create_path = io::JoinPath(testing::TmpDir(), "a//b/c/d"); TF_CHECK_OK(env->RecursivelyCreateDir(create_path)); TF_CHECK_OK(env->RecursivelyCreateDir(create_path)); // repeat creation. EXPECT_TRUE(env->FileExists(create_path)); |