summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMartin Atkins <mart@degeneration.co.uk>2021-02-22 16:45:46 -0800
committerMartin Atkins <mart@degeneration.co.uk>2021-02-23 09:05:19 -0800
commit78878105873fc1826a3d6a21356d49873e206785 (patch)
tree6cc0327731fdd15b80d02778800393c62542aa70 /cmd
parent2eaeb36cb31876de6a6a52e0cd4f16798713f345 (diff)
specsuite: Fix some regressions
Lately we've made some changes that have affected the behavior of the specsuite tests, causing them to fail. Much of this was caused by changes to the harness itself (based on hcldec), although one break in particular here was an intentional change to the implementation of modulo in upstream cty to make it produce a more accurate result when used with a fractional divisor.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hclspecsuite/runner.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/hclspecsuite/runner.go b/cmd/hclspecsuite/runner.go
index 9e48f96..db9b13f 100644
--- a/cmd/hclspecsuite/runner.go
+++ b/cmd/hclspecsuite/runner.go
@@ -11,6 +11,7 @@ import (
"sort"
"strings"
+ "github.com/zclconf/go-cty-debug/ctydebug"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/convert"
ctyjson "github.com/zclconf/go-cty/cty/json"
@@ -226,8 +227,9 @@ func (r *Runner) runTestInput(specFilename, inputFilename string, tf *TestFile)
Severity: hcl.DiagError,
Summary: "Incorrect result value",
Detail: fmt.Sprintf(
- "Input file %s produced %#v, but was expecting %#v.",
+ "Input file %s produced %#v, but was expecting %#v.\n\n%s",
inputFilename, val, tf.Result,
+ ctydebug.DiffValues(tf.Result, val),
),
})
}