diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-02-06 16:26:05 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-02-19 14:15:07 +0100 |
| commit | 819d7f9914cbb34abb76b932c05b030a34986ec2 (patch) | |
| tree | 7da743c1a0363e800a041e0310ca8cf441bc3f90 /internal/server/profile/profile_test.go | |
| parent | 4d26c8489b09acc98128715e9a2ed67558eb8105 (diff) | |
Server: Delete old files to prepare for new internal API
Diffstat (limited to 'internal/server/profile/profile_test.go')
| -rw-r--r-- | internal/server/profile/profile_test.go | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/internal/server/profile/profile_test.go b/internal/server/profile/profile_test.go deleted file mode 100644 index e246b5c..0000000 --- a/internal/server/profile/profile_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package profile - -import "testing" - -func Test_CurrentProfileIndex(t *testing.T) { - testCases := []struct { - profiles []Profile - current string - index int - }{ - { - profiles: []Profile{ - { - ID: "a", - DisplayName: "b", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - }, - current: "a", - index: 0, - }, - { - profiles: []Profile{ - { - ID: "a", - DisplayName: "a", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - { - ID: "b", - DisplayName: "b", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - }, - current: "b", - index: 1, - }, - { - profiles: []Profile{ - { - ID: "a", - DisplayName: "a", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - { - ID: "b", - DisplayName: "b", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - }, - current: "", - index: 0, - }, - { - profiles: []Profile{ - { - ID: "a", - DisplayName: "a", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - { - ID: "b", - DisplayName: "b", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - }, - current: "", - index: 0, - }, - { - profiles: []Profile{ - { - ID: "a", - DisplayName: "a", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - { - ID: "b", - DisplayName: "b", - VPNProtoList: []string{"openvpn", "wireguard"}, - }, - }, - current: "idonotexist", - index: 0, - }, - } - - for _, tc := range testCases { - pri := &Info{ - Current: tc.current, - Info: ListInfo{ - ProfileList: tc.profiles, - }, - } - got := pri.CurrentProfileIndex() - if got != tc.index { - t.Fatalf("failed getting profile index, got: '%v', want: '%v'", got, tc.index) - } - } -} |
