Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rudifa/go-testscripts-compare
Compare go test methods on a sample case
https://github.com/rudifa/go-testscripts-compare
Last synced: 24 days ago
JSON representation
Compare go test methods on a sample case
- Host: GitHub
- URL: https://github.com/rudifa/go-testscripts-compare
- Owner: rudifa
- License: apache-2.0
- Created: 2023-08-21T09:23:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-21T09:24:01.000Z (about 1 year ago)
- Last Synced: 2024-10-06T01:41:24.921Z (about 1 month ago)
- Language: Go
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compare different test methods
## 1 Normal go test
```
.
├── pkg
│ └── goeval
│ ├── testdata
│ │ ├── combo.cue
│ │ ├── raw.json
│ │ └── stdout.json
│ ├── goeval.go
│ └── goeval_test.go
``````
testscripts-compare % go test $1 ./...
? github.com/rudifa/testscripts-compare [no test files]
ok github.com/rudifa/testscripts-compare/pkg/goeval (cached)
```Adavantages:
- a well known test method
- close to the code under test
- assisted by the vscode go extension (run test, debug test, ...)## 2 `testscript` with a standalone txtar script
```
.
├── pkg
│ └── goeval
│ └── testdata
│ └── standalone.txtar
``````
testscripts-compare % testscript pkg/goeval/testdata/standalone.txtar
PASS
```Advangates:
- all-in-one script, suitable for presenting test cases in discussons and reports