diff --git a/tests/fs/files.luau b/tests/fs/files.luau index f9b2611..a49412e 100644 --- a/tests/fs/files.luau +++ b/tests/fs/files.luau @@ -9,35 +9,22 @@ local utils = require("./utils") fs.writeDir(TEMP_DIR_PATH) fs.writeDir(TEMP_ROOT_PATH) --- Write both of our files with string and buffer contents +-- Write both of our files fs.writeFile(TEMP_ROOT_PATH .. "/test_binary", utils.binaryBlob) fs.writeFile(TEMP_ROOT_PATH .. "/test_json.json", utils.jsonBlob) -fs.writeFile(TEMP_ROOT_PATH .. "/test_binary_buf", buffer.fromstring(utils.binaryBlob)) -fs.writeFile(TEMP_ROOT_PATH .. "/test_json_buf.json", buffer.fromstring(utils.jsonBlob)) - -- Make sure reading the file we just -- wrote gets us back the original strings assert( - buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_binary")) == utils.binaryBlob, - "(String) Binary file round-trip resulted in different strings" + fs.readFile(TEMP_ROOT_PATH .. "/test_binary") == utils.binaryBlob, + "Binary file round-trip resulted in different strings" ) assert( - buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_json.json")) == utils.jsonBlob, - "(String) JSON file round-trip resulted in different strings" -) - -assert( - buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_binary_buf")) == utils.binaryBlob, - "(Buffer) Binary file round-trip resulted in different strings" -) - -assert( - buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_json_buf.json")) == utils.jsonBlob, - "(Buffer) JSON file round-trip resulted in different strings" + fs.readFile(TEMP_ROOT_PATH .. "/test_json.json") == utils.jsonBlob, + "JSON file round-trip resulted in different strings" ) -- Make sure file checks succeed but dir checks fail diff --git a/tests/roblox/rbx-test-files b/tests/roblox/rbx-test-files index 52f2c1a..655b5cc 160000 --- a/tests/roblox/rbx-test-files +++ b/tests/roblox/rbx-test-files @@ -1 +1 @@ -Subproject commit 52f2c1a686e7b67d996005eeddf63b97b170a741 +Subproject commit 655b5cc6a64024709d3662cc45ec4319c87de5a2 diff --git a/types/fs.luau b/types/fs.luau index c042851..823f6f7 100644 --- a/types/fs.luau +++ b/types/fs.luau @@ -107,7 +107,7 @@ local fs = {} @param path The path to the file to read @return The contents of the file ]=] -function fs.readFile(path: string): buffer +function fs.readFile(path: string): string return nil :: any end