-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests, refactor test utilities, and improve docs
Introduced a test for the RPC server's `echoHandler` functionality, refactored `TestContext` with enhanced methods (e.g., `Expect`, `Receiver`), and added new error handling utilities. Refined documentation, including update of README with performance benchmarks, and removed unnecessary linters from configuration files.
- Loading branch information
Showing
18 changed files
with
121 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/clubpay/ronykit/example/ex-01-rpc/dto" | ||
"github.com/clubpay/ronykit/kit" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEcho(t *testing.T) { | ||
var ( | ||
reqDTO = &dto.EchoRequest{ | ||
RandomID: 2374, | ||
Ok: false, | ||
} | ||
resDTO *dto.EchoResponse | ||
errDTO *dto.ErrorMessage | ||
) | ||
err := kit.Expect( | ||
kit.NewTestContext().SetHandler(echoHandler), | ||
reqDTO, &resDTO, &errDTO, | ||
) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
assert.Nil(t, errDTO) | ||
assert.Equal(t, reqDTO.RandomID, resDTO.RandomID) | ||
assert.Equal(t, reqDTO.Ok, resDTO.Ok) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: false | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ linters: | |
enable-all: true | ||
disable: | ||
- wsl | ||
- gomnd | ||
- gochecknoglobals | ||
- paralleltest | ||
- gochecknoinits | ||
|