summaryrefslogtreecommitdiff
path: root/test/other/fs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/other/fs.lua')
-rw-r--r--test/other/fs.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/other/fs.lua b/test/other/fs.lua
new file mode 100644
index 00000000..069a2454
--- /dev/null
+++ b/test/other/fs.lua
@@ -0,0 +1,11 @@
+local fs = require 'bee.filesystem'
+local platform = require 'bee.platform'
+local path = fs.path '/a/b/c/d/e/../../../..'
+local absolute = fs.absolute(path)
+if platform.OS == 'Windows' then
+ assert(absolute:string():sub(-2) == '/a', absolute:string())
+elseif platform.OS == 'Linux' then
+ assert(absolute:string():sub(-3) == '/a/', absolute:string())
+elseif platform.OS == 'macOS' then
+ -- 不支持
+end