MCPcopy Create free account
hub / github.com/checkmake/checkmake / TestParse_FileExtAndVariableTargets

Function TestParse_FileExtAndVariableTargets

parser/parser_test.go:232–256  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

230}
231
232func TestParse_FileExtAndVariableTargets(t *testing.T) {
233 t.Parallel()
234 makefile := `
235file.ext:
236 touch $@
237$(DIR_VAR):
238 echo "dir var"
239${DIR_VAR}/subdir:
240 echo "subdir rule"
241`
242 tmp := writeTempMakefile(t, makefile)
243 defer os.Remove(tmp)
244
245 ret, err := Parse(tmp)
246 require.NoError(t, err)
247
248 targets := make([]string, len(ret.Rules))
249 for i, r := range ret.Rules {
250 targets[i] = r.Target
251 }
252
253 assert.Contains(t, targets, "file.ext")
254 assert.Contains(t, targets, "$(DIR_VAR)")
255 assert.Contains(t, targets, "${DIR_VAR}/subdir")
256}
257
258func TestParse_RuleWithEqualsInPrereq(t *testing.T) {
259 t.Parallel()

Callers

nothing calls this directly

Calls 2

writeTempMakefileFunction · 0.85
ParseFunction · 0.85

Tested by

no test coverage detected