package.path = package.path .. ";../lua/SpecSwitcher/path.lua" local PathObj = require("path") local tests = {} function tests.Always_Fail() assert(false) end function tests.Test_Path_Functionality() local path_1 = "/foo/bar/baz/beef.c" local path_2 = "//foo/bar/baz/beef.c" local path_3 = "///foo/bar/baz/beef.c" local path_4 = "foo/bar/baz/beef.c" assert( PathObj:new(path_1):to_string() == path_1 ) assert( PathObj:new(path_2):to_string() == path_2 ) assert( PathObj:new(path_3):to_string() == path_1 ) assert( PathObj:new(path_4):to_string() == path_4 ) end for test_functions in pairs(tests) do tests[test_functions]() end