Skip to content

Commit

Permalink
Fix testdata position
Browse files Browse the repository at this point in the history
  • Loading branch information
candy12t committed Nov 27, 2021
1 parent 34db364 commit a7da37a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestParseConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
configPath := filepath.Join(test.ProjectDirPath(), "test", "testdata", "config", tt.inputConfigFile)
configPath := filepath.Join("testdata", tt.inputConfigFile)
gotConfig, gotErr := ParseConfig(configPath)

test.AssertError(t, gotErr, tt.wantErr)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions test/helper.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package test

import (
"os"
"path/filepath"
"testing"
)

func ProjectDirPath() string {
currentDirPath, _ := os.Getwd()
return filepath.Join(currentDirPath, "..", "..")
}

func AssertError(t *testing.T, got, want error) {
t.Helper()
if got != want {
Expand Down

0 comments on commit a7da37a

Please sign in to comment.