Skip to content

Commit ee299f0

Browse files
committed
internal/core/adt: remove unused test code
The TODO about externalDeps has been out of date since new closedness was done in https://cuelang.org/cl/1210790, which removed the field. skipFiles hasn't done anything for evalv3 for months now, as it has been feature complete for a while. Keeping the code around isn't harmful per se, but walking all syntax trees isn't free either. Removing the step cuts `go test` by about 100ms, given that we don't run any test or subtest in parallel at the moment. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Ic16ed5fefe5a30fee389569490f827fdbef54502 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1218032 Reviewed-by: Marcel van Lohuizen <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 6405ce0 commit ee299f0

File tree

1 file changed

+2
-41
lines changed

1 file changed

+2
-41
lines changed

internal/core/adt/eval_test.go

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ import (
2424
"golang.org/x/tools/txtar"
2525

2626
"cuelang.org/go/cue"
27-
"cuelang.org/go/cue/ast"
2827
"cuelang.org/go/cue/cuecontext"
2928
"cuelang.org/go/cue/errors"
3029
"cuelang.org/go/cue/stats"
31-
"cuelang.org/go/cue/token"
3230
"cuelang.org/go/internal"
3331
"cuelang.org/go/internal/core/adt"
3432
"cuelang.org/go/internal/core/debug"
@@ -64,12 +62,6 @@ func TestEvalV2(t *testing.T) {
6462
}
6563

6664
func TestEvalV3(t *testing.T) {
67-
// TODO: remove use of externalDeps for processing. Currently, enabling
68-
// this would fix some issues, but also introduce some closedness bugs.
69-
// As a first step, we should ensure that the temporary hack of using
70-
// externalDeps to agitate pending dependencies is replaced with a
71-
// dedicated mechanism.
72-
//
7365
adt.DebugDeps = true // check unmatched dependencies.
7466

7567
cuedebug.Init()
@@ -85,42 +77,11 @@ func TestEvalV3(t *testing.T) {
8577
test.ToDo = nil
8678
}
8779

88-
var ran, skipped, errorCount int
89-
80+
var errorCount int
9081
test.Run(t, func(t *cuetxtar.Test) {
91-
if reason := skipFiles(t.Instance().Files...); reason != "" {
92-
skipped++
93-
t.Skip(reason)
94-
}
95-
ran++
96-
9782
errorCount += runEvalTest(t, internal.EvalV3, flags)
9883
})
99-
100-
t.Logf("ran: %d, skipped: %d, nodeErrors: %d",
101-
ran, skipped, errorCount)
102-
}
103-
104-
// skipFiles returns true if the given files contain CUE that is not yet handled
105-
// by the development version of the evaluator.
106-
func skipFiles(a ...*ast.File) (reason string) {
107-
// Skip disjunctions.
108-
fn := func(n ast.Node) bool {
109-
switch x := n.(type) {
110-
case *ast.BinaryExpr:
111-
if x.Op == token.OR {
112-
// Uncomment to disable disjunction testing.
113-
// NOTE: keep around until implementation of disjunctions
114-
// is complete.
115-
// reason = "disjunctions"
116-
}
117-
}
118-
return true
119-
}
120-
for _, f := range a {
121-
ast.Walk(f, fn, nil)
122-
}
123-
return reason
84+
t.Logf("nodeErrors: %d", errorCount)
12485
}
12586

12687
func runEvalTest(t *cuetxtar.Test, version internal.EvaluatorVersion, flags cuedebug.Config) (errorCount int) {

0 commit comments

Comments
 (0)