(t *testing.T)
| 131 | } |
| 132 | |
| 133 | func TestConfPreprocess(t *testing.T) { |
| 134 | t.Setenv(airWd, "_testdata/toml") |
| 135 | originalDir, err := os.Getwd() |
| 136 | if err != nil { |
| 137 | t.Fatalf("failed to getwd: %v", err) |
| 138 | } |
| 139 | t.Cleanup(func() { |
| 140 | if err := os.Chdir(originalDir); err != nil { |
| 141 | t.Fatalf("failed to restore working directory: %v", err) |
| 142 | } |
| 143 | }) |
| 144 | |
| 145 | df := defaultConfig() |
| 146 | err = df.preprocess(nil) |
| 147 | if err != nil { |
| 148 | t.Fatalf("preprocess error %v", err) |
| 149 | } |
| 150 | suffix := filepath.Join("_testdata", "toml", "tmp", "main") |
| 151 | if runtime.GOOS == "windows" { |
| 152 | suffix += ".exe" |
| 153 | } |
| 154 | binPath := df.Build.Bin |
| 155 | if !strings.HasSuffix(binPath, suffix) { |
| 156 | t.Fatalf("bin path is %s, but not have suffix %s.", binPath, suffix) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestEntrypointResolvesAbsolutePath(t *testing.T) { |
| 161 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…