mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
chore(tests, types): reflect changes in 716e8aae8e
This commit is contained in:
parent
716e8aae8e
commit
d3d1a4dbd5
3 changed files with 7 additions and 20 deletions
|
@ -9,35 +9,22 @@ local utils = require("./utils")
|
||||||
fs.writeDir(TEMP_DIR_PATH)
|
fs.writeDir(TEMP_DIR_PATH)
|
||||||
fs.writeDir(TEMP_ROOT_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_binary", utils.binaryBlob)
|
||||||
fs.writeFile(TEMP_ROOT_PATH .. "/test_json.json", utils.jsonBlob)
|
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
|
-- Make sure reading the file we just
|
||||||
-- wrote gets us back the original strings
|
-- wrote gets us back the original strings
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_binary")) == utils.binaryBlob,
|
fs.readFile(TEMP_ROOT_PATH .. "/test_binary") == utils.binaryBlob,
|
||||||
"(String) Binary file round-trip resulted in different strings"
|
"Binary file round-trip resulted in different strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
buffer.tostring(fs.readFile(TEMP_ROOT_PATH .. "/test_json.json")) == utils.jsonBlob,
|
fs.readFile(TEMP_ROOT_PATH .. "/test_json.json") == utils.jsonBlob,
|
||||||
"(String) JSON file round-trip resulted in different strings"
|
"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"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Make sure file checks succeed but dir checks fail
|
-- Make sure file checks succeed but dir checks fail
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 52f2c1a686e7b67d996005eeddf63b97b170a741
|
Subproject commit 655b5cc6a64024709d3662cc45ec4319c87de5a2
|
|
@ -107,7 +107,7 @@ local fs = {}
|
||||||
@param path The path to the file to read
|
@param path The path to the file to read
|
||||||
@return The contents of the file
|
@return The contents of the file
|
||||||
]=]
|
]=]
|
||||||
function fs.readFile(path: string): buffer
|
function fs.readFile(path: string): string
|
||||||
return nil :: any
|
return nil :: any
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue