Serge Bazanski | be538db | 2020-11-12 00:22:42 +0100 | [diff] [blame] | 1 | package cmd |
2 | |||||
3 | import ( | ||||
4 | "testing" | ||||
5 | ) | ||||
6 | |||||
7 | func TestGuessShell(t *testing.T) { | ||||
8 | t.Parallel() | ||||
9 | |||||
10 | for _, test := range [][]string{ | ||||
11 | {"/bin/bash", "bash"}, | ||||
12 | {"/usr/bin/zsh", "zsh"}, | ||||
13 | {"/usr/bin/zsh5", "zsh"}, | ||||
14 | } { | ||||
15 | if result := guessShell(test[0]); result != test[1] { | ||||
16 | t.Errorf("Guessed %q instead of %q from %q", result, test[1], test[0]) | ||||
17 | } | ||||
18 | } | ||||
19 | } |