Skip to content

Commit

Permalink
issues/69: Regenerate dumped test files (#75)
Browse files Browse the repository at this point in the history
- This is a follow up to #73
- Updates: #69
  • Loading branch information
komuw authored Mar 1, 2024
1 parent af7087e commit 45969d5
Show file tree
Hide file tree
Showing 80 changed files with 838 additions and 56 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:

- name: tests and benchmarks
run: |
go test -count=1 -timeout 1m --exec=/bin/true ./...
go test -count=1 -timeout 1m --exec=/bin/true -trimpath ./...
run_tests:
Expand All @@ -104,8 +104,8 @@ jobs:

- name: tests and benchmarks
run: |
go test -timeout 1m -race -run=XXXX -bench=. ./...
go test -timeout 4m -race ./...
go test -timeout 1m -race -run=XXXX -bench=. -trimpath ./...
go test -timeout 4m -race -trimpath ./...
- name: test coverage
run: |
Expand All @@ -117,7 +117,7 @@ jobs:
shasum --algorithm 512 --check <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA512SUM" | grep codecov)
rm -rf codecov
go test -timeout 4m -race -cover -coverprofile=coverage.out ./... && bash <(curl -s https://codecov.io/bash)
go test -timeout 4m -race -cover -coverprofile=coverage.out -trimpath ./... && bash <(curl -s https://codecov.io/bash)
go tool cover -html=coverage.out -o coverage.html
go tool cover -func=coverage.out
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
find . -name "*.go" | xargs -n 1 sed -i.backup 's/sync.Mutex/deadlock.Mutex/'
find . -name '*.backup' -delete
/home/runner/go/bin/goimports -w .
go test -timeout 4m -race ./...
go test -timeout 4m -race -trimpath ./...
go mod tidy

# error shadowing
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Most recent version is listed first.
- Support older Go versions: https://github.com/komuw/kama/pull/71
- Stackp can now write to any io.writer: https://github.com/komuw/kama/pull/74
- Display stacktrace when dumping variables: https://github.com/komuw/kama/pull/73
https://github.com/komuw/kama/pull/75

# v0.0.19
- Update docs: https://github.com/komuw/kama/commit/3dfdef76fbdd55a8ebed2d01dfb1cbb7c1cf2fc2
Expand Down
105 changes: 59 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ that will print:
[
NAME: compress/flate
CONSTANTS: [
BestCompression untyped int
BestSpeed untyped int
DefaultCompression untyped int
HuffmanOnly untyped int
NoCompression untyped int
]
BestCompression untyped int
BestSpeed untyped int
DefaultCompression untyped int
HuffmanOnly untyped int
NoCompression untyped int
]
VARIABLES: []
FUNCTIONS: [
NewReader(r io.Reader) io.ReadCloser
NewReaderDict(r io.Reader, dict []byte) io.ReadCloser
NewWriter(w io.Writer, level int) (*Writer, error)
NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error)
]
NewReader(r io.Reader) io.ReadCloser
NewReaderDict(r io.Reader, dict []byte) io.ReadCloser
NewWriter(w io.Writer, level int) (*Writer, error)
NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error)
]
TYPES: [
CorruptInputError int64
(CorruptInputError) Error() string
InternalError string
(InternalError) Error() string
ReadError struct
(*ReadError) Error() string
Reader interface
(Reader) Read(p []byte) (n int, err error)
(Reader) ReadByte() (byte, error)
Resetter interface
(Resetter) Reset(r io.Reader, dict []byte) error
WriteError struct
(*WriteError) Error() string
Writer struct
(*Writer) Close() error
(*Writer) Flush() error
(*Writer) Reset(dst io.Writer)
(*Writer) Write(data []byte) (n int, err error)]
CorruptInputError int64
(CorruptInputError) Error() string
InternalError string
(InternalError) Error() string
ReadError struct
(*ReadError) Error() string
Reader interface
(Reader) Read(p []byte) (n int, err error)
(Reader) ReadByte() (byte, error)
Resetter interface
(Resetter) Reset(r io.Reader, dict []byte) error
WriteError struct
(*WriteError) Error() string
Writer struct
(*Writer) Close() error
(*Writer) Flush() error
(*Writer) Reset(dst io.Writer)
(*Writer) Write(data []byte) (n int, err error)]
]
```
```bash
Expand All @@ -94,24 +94,24 @@ NAME: github.com/pkg/errors
CONSTANTS: []
VARIABLES: []
FUNCTIONS: [
As(err error, target interface{}) bool
Cause(err error) error
Errorf(format string, args ...interface{}) error
Is(err error, target error) bool
New(message string) error
Unwrap(err error) error
WithMessage(err error, message string) error
WithMessagef(err error, format string, args ...interface{}) error
WithStack(err error) error
Wrap(err error, message string) error
Wrapf(err error, format string, args ...interface{}) error
]
As(err error, target interface{}) bool
Cause(err error) error
Errorf(format string, args ...interface{}) error
Is(err error, target error) bool
New(message string) error
Unwrap(err error) error
WithMessage(err error, message string) error
WithMessagef(err error, format string, args ...interface{}) error
WithStack(err error) error
Wrap(err error, message string) error
Wrapf(err error, format string, args ...interface{}) error
]
TYPES: [
Frame uintptr
(Frame) Format(s fmt.State, verb rune)
(Frame) MarshalText() ([]byte, error)
StackTrace []Frame
(StackTrace) Format(s fmt.State, verb rune)]
Frame uintptr
(Frame) Format(s fmt.State, verb rune)
(Frame) MarshalText() ([]byte, error)
StackTrace []Frame
(StackTrace) Format(s fmt.State, verb rune)]
]
```

Expand Down Expand Up @@ -165,15 +165,28 @@ METHODS: [
MultipartReader func(*http.Request) (*multipart.Reader, error)
ParseForm func(*http.Request) error
ParseMultipartForm func(*http.Request, int64) error
PathValue func(*http.Request, string) string
PostFormValue func(*http.Request, string) string
ProtoAtLeast func(*http.Request, int, int) bool
Referer func(*http.Request) string
SetBasicAuth func(*http.Request, string, string)
SetPathValue func(*http.Request, string, string)
UserAgent func(*http.Request) string
WithContext func(*http.Request, context.Context) *http.Request
Write func(*http.Request, io.Writer) error
WriteProxy func(*http.Request, io.Writer) error
]
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

/home/komu/mystuff/kama/kama.go:129 github.com/komuw/kama.Dir
/home/komu/mystuff/kama/kama_test.go:244 github.com/komuw/kama.TestReadmeExamples.func1
/usr/local/go/src/testing/testing.go:1689 testing.tRunner
/usr/local/go/src/runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: &Request{
Method: "GET",
URL: &URL{
Expand Down
2 changes: 1 addition & 1 deletion kama_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func TestReadmeExamples(t *testing.T) {

res := Dir(v.item)

path := getDataPath(t, "kama_test.go", v.tName)
path := getDataPath(t, "kama_test.go", "TestReadmeExamples_"+v.tName)
dealWithTestData(t, path, res)
})
}
Expand Down
11 changes: 11 additions & 0 deletions testdata/e2e_test/&SomeConcreteError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ FIELDS: []
METHODS: [
Error func() string
]
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: &error(unable to read from ftp file)
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/NilEmptyInterface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ KIND: ptr
SIGNATURE: [nil]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:85 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: nil
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/NonNilEmptyInterface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ KIND: int
SIGNATURE: [int]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: int(9)
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/SomeConcreteError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ FIELDS: []
METHODS: [
Error func(*errors.errorString) string
]
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: error(unable to read from ftp file)
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/SomeNilError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ KIND: ptr
SIGNATURE: [nil]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:85 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: nil
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/SomeReader.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ METHODS: [
UnreadRune func(*strings.Reader) error
WriteTo func(*strings.Reader, io.Writer) (int64, error)
]
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:471 github.com/komuw/kama_test.TestAllAboutInterfaces.func1.1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: &Reader{
}
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/custom_string_type.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@ METHODS: [
GoString func(kama_test.secretKey) string
String func(kama_test.secretKey) string
]
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:90 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:268 github.com/komuw/kama_test.TestDir.func1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: secretKey(T<REDACTED>)
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/map_in_a_struct_is_not_compacted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ FIELDS: [
XX map[int]string
]
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:268 github.com/komuw/kama_test.TestDir.func1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: someStructWithMap{
XX: map[int]string{
int(0): "0",
Expand Down
11 changes: 11 additions & 0 deletions testdata/e2e_test/map_on_its_own_is_not_compacted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ KIND: map
SIGNATURE: [map[int]string]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:268 github.com/komuw/kama_test.TestDir.func1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: map[int]string{
int(0): "0",
int(1): "1",
Expand Down
11 changes: 11 additions & 0 deletions testdata/e2e_test/normal_string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ KIND: string
SIGNATURE: [string]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:124 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:268 github.com/komuw/kama_test.TestDir.func1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: "heyWorldOkay"
]
11 changes: 11 additions & 0 deletions testdata/e2e_test/number_float32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ KIND: float32
SIGNATURE: [float32]
FIELDS: []
METHODS: []
STACK_TRACE: [
LEGEND:
compiler: blue
thirdParty: yellow
yours: red

 github.com/komuw/kama/kama.go:129 github.com/komuw/kama.Dir
 github.com/komuw/kama/e2e_test.go:268 github.com/komuw/kama_test.TestDir.func1
 testing/testing.go:1689 testing.tRunner
 runtime/asm_amd64.s:1695 runtime.goexit
]
SNIPPET: float32(32)
]
Loading

0 comments on commit 45969d5

Please sign in to comment.