mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
34 lines
828 B
Bash
Executable File
34 lines
828 B
Bash
Executable File
#! /usr/bin/env bash
|
|
source "../../test-helper.sh"
|
|
source "${root}/lib/layout-helpers.sh"
|
|
|
|
#
|
|
# __expand_path() tests.
|
|
#
|
|
|
|
# Setup.
|
|
realHOME="$HOME"
|
|
HOME="/home/test-user"
|
|
|
|
# When given a path containing "~", it expands "~" to "$HOME".
|
|
assert '__expand_path "~/Foo/Bar"' "${HOME}/Foo/Bar"
|
|
|
|
# When given a path without "~", it returns path as is.
|
|
assert '__expand_path "/path/to/file"' "/path/to/file"
|
|
|
|
# When given a path containing spaces, it returns path correctly.
|
|
assert '__expand_path "~/Path To/File"' "${HOME}/Path To/File"
|
|
|
|
# When given a relative path, it returns path as is.
|
|
assert '__expand_path "foo/bar"' "foo/bar"
|
|
|
|
# When given a relative parent path, it returns path as is.
|
|
assert '__expand_path "../foo/bar"' "../foo/bar"
|
|
|
|
# Tear down.
|
|
HOME="$realHOME"
|
|
unset realHOME
|
|
|
|
# End of tests.
|
|
assert_end "__expand_path()"
|