use plain pkg module

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2025-01-13 15:54:00 +01:00
committed by Florian Schade
parent 259cbc2e56
commit b07b5a1149
841 changed files with 1383 additions and 1366 deletions

26
pkg/ast/test/test.go Normal file
View File

@@ -0,0 +1,26 @@
// Package test provides shared test primitives for ast testing.
package test
import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/opencloud-eu/opencloud/pkg/ast"
)
// DiffAst returns a human-readable report of the differences between two values
// by default it ignores every ast node Base field.
func DiffAst(x, y interface{}, opts ...cmp.Option) string {
return cmp.Diff(
x,
y,
append(
opts,
cmpopts.IgnoreFields(ast.Ast{}, "Base"),
cmpopts.IgnoreFields(ast.StringNode{}, "Base"),
cmpopts.IgnoreFields(ast.OperatorNode{}, "Base"),
cmpopts.IgnoreFields(ast.GroupNode{}, "Base"),
cmpopts.IgnoreFields(ast.BooleanNode{}, "Base"),
cmpopts.IgnoreFields(ast.DateTimeNode{}, "Base"),
)...,
)
}