-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, the build would fail if the mock struct line contained a doc comment. Now, the build will pass, and doc comments on the struct and methods will be propagated to the generated code. Fixes #100
- Loading branch information
Showing
4 changed files
with
79 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// vim: tw=80 | ||
use mockall::*; | ||
|
||
// mock! should allow doc comments in all reasonable positions. This test | ||
// ensures that the code will compile. mockall_derive has a unit test to ensure | ||
// that the doc comments are correctly placed. | ||
|
||
trait Tr { | ||
fn bar(&self); | ||
} | ||
|
||
mock!{ | ||
/// Struct docs | ||
pub Foo { | ||
/// Method docs | ||
fn foo(&self); | ||
} | ||
trait Tr { | ||
/// Trait method docs | ||
fn bar(&self); | ||
} | ||
} | ||
|
||
|
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