local N=require("\064\102\114\107\116\101\115\116\047")local f=N.test local u=N.assert.check local p=require("\046\046\047\115\114\099\047\108\105\098")return function()f.suite("\106\111\105\110\105\110\103 \112\097\116\104\115",function()local N=p.Path.from("\116\101\115\116\115\047\116\101\115\116\049\046\116\120\116")f.case("\112\097\116\104 \097\110\100 \115\116\114\105\110\103",function()local f=p.Path.from("\116\101\115\116\115")u.is_true((f:join("\116\101\115\116\049\046\116\120\116")):equal(N))end)f.case("\112\097\116\104 \097\110\100 \112\097\116\104",function()local f=p.Path.from("\116\101\115\116\115")local b=p.Path.from("\116\101\115\116\049\046\116\120\116")u.is_true((f:join(b)):equal(N))end)f.case("\112\097\116\104 \097\110\100 \099\111\109\112\111\110\101\110\116\115",function()local f=p.Path.from("\116\101\115\116\115")local b=(p.Path.from("\116\101\115\116\049\046\116\120\116")):components()u.is_true((f:join(b)):equal(N))end)end)end
local frktest = require("@frktest/")
local test = frktest.test
local check = frktest.assert.check
local pathfs = require("../src/lib")

return function()
	test.suite("joining paths", function()
		local expectedResultPath = pathfs.Path.from("tests/test1.txt")

		test.case("path and string", function()
			local path = pathfs.Path.from("tests")
			check.is_true(path:join("test1.txt"):equal(expectedResultPath))
		end)

		test.case("path and path", function()
			local path = pathfs.Path.from("tests")
			local path2 = pathfs.Path.from("test1.txt")
			check.is_true(path:join(path2):equal(expectedResultPath))
		end)

		test.case("path and components", function()
			local path = pathfs.Path.from("tests")
			local components = pathfs.Path.from("test1.txt"):components()
			check.is_true(path:join(components):equal(expectedResultPath))
		end)
	end)
end
