Skip to content

Commit 6fc8928

Browse files
committed
move benchmark code to tests
1 parent 6a2091d commit 6fc8928

File tree

12 files changed

+187
-36
lines changed

12 files changed

+187
-36
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
go-version: "${{ matrix.go_version }}"
4040

4141
- run: go test -coverpkg=./... -covermode=atomic -coverprofile=coverage.out -count=1 ./...
42-
working-directory: testdata
42+
working-directory: tests
4343

4444
- uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5
4545
with:
46-
files: testdata/coverage.out
46+
files: tests/coverage.out
4747
token: ${{ secrets.CODECOV_TOKEN }}

bench/go.mod

Lines changed: 0 additions & 12 deletions
This file was deleted.

bench/go.sum

Lines changed: 0 additions & 14 deletions
This file was deleted.

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ So a malicious input like `a:100000000:{}` may become `make([]T, 100000000)` and
7878
If you have to decode some un-trusted bytes, make sure only decode them into fixed-length golang array or struct,
7979
never decode them to `interface`, `slice` or `map`.
8080

81+
## benchmark
82+
83+
see <./tests/bench.txt>
84+
8185
## License
8286

8387
MIT License

tests/bench.txt

Lines changed: 171 additions & 0 deletions
Large diffs are not rendered by default.

bench/bench_test.go renamed to tests/bench_cmp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bench
1+
package tests
22

33
import (
44
"testing"

testdata/bench_test.go renamed to tests/bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package phpserialize_test
1+
package tests
22

33
import (
44
"fmt"

testdata/go.mod renamed to tests/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
module phpserialize_test
1+
module tests
22

33
go 1.20
44

55
require (
6+
github.com/elliotchance/phpserialize v1.4.0
67
github.com/fatih/color v1.18.0
78
github.com/sergi/go-diff v1.3.1
89
github.com/stretchr/testify v1.10.0

testdata/go.sum renamed to tests/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/elliotchance/phpserialize v1.4.0 h1:cAp/9+KSnEbUC8oYCE32n2n84BeW8HOY3HMDI8hG2OY=
5+
github.com/elliotchance/phpserialize v1.4.0/go.mod h1:gt7XX9+ETUcLXbtTKEuyrqW3lcLUAeS/AnGZ2e49TZs=
46
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
57
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
68
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
File renamed without changes.

0 commit comments

Comments
 (0)