MCPcopy
hub / github.com/air-verse/air / TestConfPreprocess

Function TestConfPreprocess

runner/config_test.go:133–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func 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
160func TestEntrypointResolvesAbsolutePath(t *testing.T) {
161 t.Parallel()

Callers

nothing calls this directly

Calls 2

defaultConfigFunction · 0.85
preprocessMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…