repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by admin
wezterm/tests/session_test.nu
Rawuse std/assert
let root = ($env.FILE_PWD | path join '..' | path expand | str replace --all '\' '/')
let temp = (mktemp --directory | str replace --all '\' '/')
let config = ($temp | path join wezterm.lua)
let source = r#'
package.path = '@ROOT@/?.lua;' .. package.path
dofile('@ROOT@/tests/session_layout.lua')
local sessions = require 'bugabinga.sessions'
local file = assert(io.open('@TEMP@/bootstrap.nu', 'w'))
file:write(sessions.bootstrap('fixture', {'nu', '--no-config-file'}))
file:close()
return {}
'#
$source | str replace --all '@ROOT@' $root | str replace --all '@TEMP@' $temp | save $config
let result = (^wezterm --config-file $config show-keys | complete)
let parsed = (nu-check ($temp | path join bootstrap.nu))
rm --recursive --force $temp
assert equal $result.exit_code 0 $result.stderr
assert $parsed 'Restore bootstrap must parse'
print 'Session layout and bootstrap syntax tests passed'