// SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2021-2024 Simon Ruderich package sync import ( "testing" "ruderich.org/simon/safcm/testutil" ) func TestTriggerPaths(t *testing.T) { tests := []struct { name string path string exp []string }{ { "root", "/", []string{"/"}, }, { "absolute path", "/foo/bar/baz", []string{"/", "/foo", "/foo/bar", "/foo/bar/baz"}, }, { "dot", ".", []string{"."}, }, { "relative path (for tests)", "foo/bar/baz", []string{".", "foo", "foo/bar", "foo/bar/baz"}, }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { res := triggerPaths(tc.path) testutil.AssertEqual(t, "res", res, tc.exp) }) } }