refactor: modernize stdlib usage and move matchers into dsl
All checks were successful
build-dsl-smoke / Build judge (push) Successful in 16s
build-dsl-smoke / debug / clang / linux (push) Successful in 6s
build-dsl-smoke / debug / gcc / linux (push) Successful in 7s
build-dsl-smoke / release / clang / linux (push) Successful in 8s
build-dsl-smoke / release / gcc / linux (push) Successful in 9s
build-dsl-smoke / sanitized / gcc / linux (push) Successful in 6s
build-dsl-smoke / sanitized / clang / linux (push) Successful in 9s
build-dsl-smoke / debug-valgrind / gcc / linux (push) Successful in 15s
build-dsl-smoke / debug / clang / windows (push) Successful in 15s
build-dsl-smoke / debug / msvc / windows (push) Successful in 19s
build-dsl-smoke / release / clang / windows (push) Successful in 18s
build-dsl-smoke / release / msvc / windows (push) Successful in 18s
build-dsl-smoke / SUMMARY (push) Successful in 4s

- Move Matcher types and matching logic from runner/matcher.go into
  the dsl package as methods on the Matcher types. Runner now calls
  t.Stdout.Match(label, actual) instead of type-switching via a
  package-level applyMatcher helper.
- Replace custom contains/containsString helpers with slices.Contains
  in dsl/build.go and runner/compiler.go.
- Use maps.Copy instead of manual map copy in BuildConfig.MergeFrom.
- Adopt strings.SplitSeq, strings.CutPrefix and the `for range N` loop
  form in runner/limiter_linux.go.
- Ignore example/imdb build artifact.
This commit is contained in:
2026-04-15 21:24:11 +03:00
parent 52202abb53
commit c85c65ed49
8 changed files with 123 additions and 139 deletions

View File

@@ -558,10 +558,10 @@ func (r *Runner) runTest(t *dsl.Test) *TestResult {
tr.addFailure("exit code: expected %d, got %d", *t.ExitCode, actualCode)
}
for _, f := range applyMatcher("stdout", t.Stdout, tr.ActualStdout) {
for _, f := range t.Stdout.Match("stdout", tr.ActualStdout) {
tr.addFailure("%s", f)
}
for _, f := range applyMatcher("stderr", t.Stderr, tr.ActualStderr) {
for _, f := range t.Stderr.Match("stderr", tr.ActualStderr) {
tr.addFailure("%s", f)
}