From f8ae03ecc42a510e42dcabcbc7fa5af258915932 Mon Sep 17 00:00:00 2001 From: cornfeedhobo Date: Fri, 25 Sep 2020 08:09:30 -0500 Subject: [PATCH] add test for deduplication --- test/lib/helpers.bats | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index 6721070c..cae60fd1 100644 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -72,6 +72,14 @@ function local_setup { assert_equal "${new_paths}:${old_path}" "${PATH}" } +@test 'helpers: pathmunge: multiple paths, with duplicate' { + new_paths='/tmp/fake-pathmunge-path1:/tmp/fake pathmunge path2:/tmp/fake-pathmunge-path1:/tmp/fake-pathmunge-path3' + want_paths='/tmp/fake pathmunge path2:/tmp/fake-pathmunge-path1:/tmp/fake-pathmunge-path3' + old_path="${PATH}" + pathmunge "${new_paths}" + assert_equal "${want_paths}:${old_path}" "${PATH}" +} + @test "helpers: bash-it help aliases ag" { run bash-it help aliases "ag" assert_line -n 0 "ag='ag --smart-case --pager=\"less -MIRFX'"