summaryrefslogtreecommitdiff
path: root/test/other/fs.lua
blob: 069a245482a1623871eb5e15cc418d02faaaa458 (plain)
1
2
3
4
5
6
7
8
9
10
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