summaryrefslogtreecommitdiff
path: root/cmd/hclspecsuite
AgeCommit message (Collapse)Author
2023-02-28[COMPLIANCE] Add Copyright and License Headers (#586)hashicorp-copywrite[bot]
* [COMPLIANCE] Add Copyright and License Headers * add copywrite file and revert headers in testdata --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2021-02-23specsuite: Fix some regressionsMartin Atkins
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.
2019-12-11Fix import ordering from the move from hcl2 repositoryMartin Atkins
When we did the automatic rewriting from the hashicorp/hcl2 import paths to hashicorp/hcl/v2 import paths, our automatic rewrite script did not run "go fmt" afterwards and so left some imports misordered as a result of the slightly-differently-shaped directory structure in the new repository.
2019-10-01cmd/hclspecsuite: run hcldec with --keep-nullsMartin Atkins
This gives us a more precise picture of the result, which is helpful to ensure our tests are not "cheating".
2019-09-09Unfold the "hcl" directory up into the rootMartin Atkins
The main HCL package is more visible this way, and so it's easier than having to pick it out from dozens of other package directories.
2019-09-09Change module path to github.com/hashicorp/hcl/v2Martin Atkins
This is in preparation for the first v2 release from the main HCL repository.
2018-12-14cmd/hclspecsuite: Generate correct ranges in diagnostic-diagnosticsMartin Atkins
We were taking a pointer to a for loop iterator variable and thus capturing the final iteration value rather than each one separately. By using the .Ptr() method instead, we force a copy of the range which we then take a pointer to.
2018-08-12hcl/spectests: run the spec testsuite as part of "go test"Martin Atkins
Although the spec testsuite and associated harness is designed to be usable by other implementations of HCL not written in Go, it's convenient to run it as part of our own "go test" test suite here so there isn't an additional thing to run on each change. To achieve this, the new package hcl/spectests will build both hcldec and hclspecsuite from latest source and then run the latter to execute the test suite, capturing the output and converting it (sloppily) into testing.T method calls to produce something vaguely reasonable. Other than the small amount of "parsing" to make it look in the output like a normal Go test, there's nothing special going on here and so it's still valid to run the spec suite manually with a build of hcldec from this codebase, which should produce the same result.
2018-08-12cmd/hclspecsuite: show source snippets for errors in .hcldec filesMartin Atkins
2018-08-12cmd/hclspecsuite: Check for expected diagnosticsMartin Atkins
When a test file declares one or more expected diagnostics, we check those instead of checking the result value. The severities and source ranges must match. We don't test the error messages themselves because they are not part of the specification and may vary between implementations or, in future, be translated into other languages.
2018-08-12cmd/hclspecsuite: Check for traversals when requestedMartin Atkins
2018-08-11cmd/hclspecsuite: Decode expected traversals and diagnosticsMartin Atkins
These are not used by the test harness yet, but they can now be decoded from a test spec file.
2018-08-10cmd/hclspecsuite: basic runner functionality for successful casesMartin Atkins
The harness can now run tests that decode successfully and compare the result with a given value. Further work is required in later commits to deal with other cases, such as tests that intentionally produce errors.
2018-08-09specsuite: Start of the harness for the specification test suiteMartin Atkins