diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-06-15 15:45:45 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-15 22:19:00 +0200 |
commit | 97923e3d26d2fb5a6be6c00b8d8d6a085cf71b8e (patch) | |
tree | b535881c51659cc9d79f3759e97e440f00adf3ef /deno2/file_util_test.cc | |
parent | b2694ecbd85a5a32803e24f1d6c9020173408646 (diff) |
Fix error handling in deno::ReadFileToString
Starts a unit test for it, and adds to mock_runtime_test.
Diffstat (limited to 'deno2/file_util_test.cc')
-rw-r--r-- | deno2/file_util_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/deno2/file_util_test.cc b/deno2/file_util_test.cc new file mode 100644 index 000000000..3b1c3e239 --- /dev/null +++ b/deno2/file_util_test.cc @@ -0,0 +1,13 @@ +// Copyright 2018 Ryan Dahl <ry@tinyclouds.org> +// All rights reserved. MIT License. +#include "testing/gtest/include/gtest/gtest.h" + +#include "file_util.h" + +TEST(FileUtilTest, ReadFileToStringFileNotExist) { + std::string output; + EXPECT_FALSE(deno::ReadFileToString("/should_error_out.txt", &output)); +} + +// TODO(ry) success unit test. Needs a tempfile or fixture. +// TEST(FileUtilTest, ReadFileToStringSuccess) { } |