Skip to content

Commit

Permalink
auto_test: Rename to auto_test
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Moroo <[email protected]>
  • Loading branch information
retrage committed Mar 11, 2023
1 parent e27df28 commit fa64e94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ ChatGPT powered Rust macro that automatically generates test cases for given fun
See this example:

```rust
use gpt_auto_test::gpt_auto_test;
use gpt_auto_test::auto_test;

#[gpt_auto_test(test_valid, test_div_by_zero)]
#[auto_test(test_valid, test_div_by_zero)]
fn div_u32(a: u32, b: u32) -> u32 {
if b == 0 {
panic!("attempt to divide by zero");
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl Parse for Args {
/// # Example
///
/// ```
/// use r#gpt_auto_test::gpt_auto_test;
/// use r#gpt_auto_test::auto_test;
///
/// #[gpt_auto_test(test_valid, test_div_by_zero)]
/// #[auto_test(test_valid, test_div_by_zero)]
/// fn div_u32(a: u32, b: u32) -> u32 {
/// a / b
/// }
/// ```
#[proc_macro_attribute]
pub fn gpt_auto_test(args: TokenStream, input: TokenStream) -> TokenStream {
pub fn auto_test(args: TokenStream, input: TokenStream) -> TokenStream {
// Parse the list of test function names that should be generated.
let args = parse_macro_input!(args as Args);

Expand Down
4 changes: 2 additions & 2 deletions tests/fn.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
// Akira Moroo <[email protected]> 2023

use gpt_auto_test::gpt_auto_test;
use gpt_auto_test::auto_test;

#[gpt_auto_test(test_valid, test_div_by_zero)]
#[auto_test(test_valid, test_div_by_zero)]
fn div_u32(a: u32, b: u32) -> u32 {
if b == 0 {
panic!("attempt to divide by zero");
Expand Down

0 comments on commit fa64e94

Please sign in to comment.