File tree 6 files changed +71
-24
lines changed
6 files changed +71
-24
lines changed Original file line number Diff line number Diff line change
1
+ name : Tests
2
+ on : [pull_request]
3
+
4
+ jobs :
5
+ test :
6
+ name : Test
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : actions/checkout@v3
10
+
11
+ - name : Setup Go
12
+ uses : actions/setup-go@v3
13
+ with :
14
+ go-version : ' stable'
15
+
16
+ - name : Go Tests
17
+ run : go test -v ./...
Original file line number Diff line number Diff line change
1
+ name : release
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+
7
+ jobs :
8
+ release :
9
+ name : Build and Release
10
+ runs-on : [ubuntu-latest]
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v3
14
+
15
+ - name : Release Version
16
+ id : version
17
+ run : |
18
+ export RELEASE_VERSION=v0.0.${{ github.run_number }}
19
+ echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
20
+ echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
21
+
22
+ - name : create tag
23
+ run : |
24
+ git config --local user.email "[email protected] "
25
+ git config --local user.name "GitHub Action"
26
+ git tag -a $RELEASE_VERSION -m $RELEASE_VERSION
27
+ git push origin $RELEASE_VERSION
28
+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ module github.com/jasonhancock/multiplex
2
+
3
+ go 1.21.3
4
+
5
+ require github.com/stretchr/testify v1.8.4
6
+
7
+ require (
8
+ github.com/davecgh/go-spew v1.1.1 // indirect
9
+ github.com/pmezard/go-difflib v1.0.0 // indirect
10
+ gopkg.in/yaml.v3 v3.0.1 // indirect
11
+ )
Original file line number Diff line number Diff line change
1
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
2
+ github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
3
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
4
+ github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
5
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk =
6
+ github.com/stretchr/testify v1.8.4 /go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo =
7
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
8
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
9
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
10
+ gopkg.in/yaml.v3 v3.0.1 /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
Original file line number Diff line number Diff line change @@ -7,12 +7,10 @@ import (
7
7
"testing"
8
8
"time"
9
9
10
- "github.com/cheekybits/is "
10
+ "github.com/stretchr/testify/require "
11
11
)
12
12
13
13
func TestPlexer (t * testing.T ) {
14
- is := is .New (t )
15
-
16
14
var chans []chan []byte
17
15
for i := 0 ; i < 10 ; i ++ {
18
16
chans = append (chans , make (chan []byte , 1000 ))
@@ -50,14 +48,12 @@ func TestPlexer(t *testing.T) {
50
48
mod ++
51
49
}
52
50
val , err := strconv .Atoi (string (values [i ]))
53
- is . NoErr ( err )
54
- is .True (val % 10 == mod )
51
+ require . NoError ( t , err )
52
+ require .True (t , val % 10 == mod )
55
53
}
56
54
}
57
55
58
56
func TestPlexerCloseChan (t * testing.T ) {
59
- is := is .New (t )
60
-
61
57
var chans []chan []byte
62
58
63
59
for i := 0 ; i < 10 ; i ++ {
@@ -94,8 +90,8 @@ func TestPlexerCloseChan(t *testing.T) {
94
90
}
95
91
wg .Wait ()
96
92
97
- is .Equal (values [ 0 ] , []byte ("foo" ))
98
- is .Equal (values [ 1 ] , []byte ("bar" ))
93
+ require .Equal (t , []byte ("foo" ), values [ 0 ] )
94
+ require .Equal (t , []byte ("bar" ), values [ 1 ] )
99
95
}
100
96
101
97
func chConv (channels ... chan []byte ) []<- chan []byte {
You can’t perform that action at this time.
0 commit comments