This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to unify README styles (#338)
- Loading branch information
Showing
12 changed files
with
82 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ mockgen/mockgen | |
|
||
# A binary produced by gotest. | ||
#gomock/[568]\.out | ||
|
||
# Editors | ||
.vscode |
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
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
5 changes: 4 additions & 1 deletion
5
...en/internal/tests/import_source/Readme.md → ...en/internal/tests/import_source/README.md
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Import Source | ||
|
||
Test the case where the generated code uses a type defined in the source package (in source mode). There are two test cases: | ||
|
||
- the output is in a new package | ||
- the output is in the same package as the input | ||
- the output is in the same package as the input |
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
# Mock in Test Package | ||
|
||
Test the case where the package has the `_test` suffix. | ||
|
||
Prior to patch: | ||
|
||
$ go generate | ||
$ go test | ||
# github.com/golang/mock/mockgen/internal/tests/mock_in_test_package_test [github.com/golang/mock/mockgen/internal/tests/mock_in_test_package.test] | ||
./mock_test.go:36:44: undefined: User | ||
./mock_test.go:38:21: undefined: User | ||
FAIL github.com/golang/mock/mockgen/internal/tests/mock_in_test_package [build failed] | ||
```bash | ||
$ go generate | ||
$ go test | ||
# github.com/golang/mock/mockgen/internal/tests/mock_in_test_package_test [github.com/golang/mock/mockgen/internal/tests/mock_in_test_package.test] | ||
./mock_test.go:36:44: undefined: User | ||
./mock_test.go:38:21: undefined: User | ||
FAIL github.com/golang/mock/mockgen/internal/tests/mock_in_test_package [build failed] | ||
``` | ||
|
||
With this patch applied: | ||
|
||
$ go generate | ||
$ go test | ||
ok github.com/golang/mock/mockgen/internal/tests/mock_in_test_package 0.031s | ||
```bash | ||
$ go generate | ||
$ go test | ||
ok github.com/golang/mock/mockgen/internal/tests/mock_in_test_package 0.031s | ||
``` |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# Unexported Method | ||
|
||
From #52, this tests an unexported method in the mocked interface. |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# Vendor Dep | ||
|
||
Test for [Issue#4](https://github.com/golang/mock/issues/4). | ||
Also see discussion on [#28](https://github.com/golang/mock/pull/28). |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# Vendor Pkg | ||
|
||
Test for [Issue#4](https://github.com/golang/mock/issues/4). |
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
# Samples | ||
|
||
This directory contains an example of a package containing a non-trivial | ||
interface that can be mocked with GoMock. The interesting files are: | ||
|
||
* `user.go`: Source code for the sample package, containing interfaces to be | ||
* `user.go`: Source code for the sample package, containing interfaces to be | ||
mocked. This file depends on the packages named imp[1-4] for various things. | ||
|
||
* `user_test.go`: A test for the sample package, in which mocks of the | ||
* `user_test.go`: A test for the sample package, in which mocks of the | ||
interfaces from `user.go` are used. This demonstrates how to create mock | ||
objects, set up expectations, and so on. | ||
|
||
* `mock_user/mock_user.go`: The generated mock code. See ../gomock/matchers.go | ||
* `mock_user/mock_user.go`: The generated mock code. See ../gomock/matchers.go | ||
for the `go:generate` command used to generate it. | ||
|
||
To run the test, | ||
|
||
go test github.com/golang/mock/sample | ||
```bash | ||
go test github.com/golang/mock/sample | ||
``` |