| 176 | } |
| 177 | |
| 178 | func TestFollowSymlinks(t *testing.T) { |
| 179 | // Arrange |
| 180 | paths := []string{"testdata/symlink", "testdata/file1.symlink.sql"} |
| 181 | |
| 182 | // Act |
| 183 | result, err := Glob(paths) |
| 184 | |
| 185 | // Assert |
| 186 | expected := []string{ |
| 187 | filepath.Join("testdata", "symlink", "file1.sql"), |
| 188 | filepath.Join("testdata", "symlink", "file1.symlink.sql"), |
| 189 | filepath.Join("testdata", "symlink", "file2.sql"), |
| 190 | filepath.Join("testdata", "file1.symlink.sql"), |
| 191 | } |
| 192 | if !cmp.Equal(result, expected) { |
| 193 | t.Errorf("Expected %v, but got %v", expected, result) |
| 194 | } |
| 195 | if err != nil { |
| 196 | t.Errorf("Expected no error, but got %v", err) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | func TestGlobPattern(t *testing.T) { |
| 201 | // Arrange |