Skip to content

Commit

Permalink
Adds docstring for test macros (#2576)
Browse files Browse the repository at this point in the history
add docstring for test macros

Co-authored-by: Kaya Gökalp <[email protected]>
  • Loading branch information
eureka-cpu and kayagokalp authored Aug 20, 2022
1 parent 1bcec29 commit b6acf0b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sway-fmt-v2/src/utils/expr/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Specific tests for the expression module
use crate::{Format, Formatter};
use forc_util::{println_green, println_red};
use paste::paste;
Expand All @@ -18,7 +20,15 @@ fn format_code(input: &str) -> String {

buf
}

/// convenience macro for generating test cases
/// provide a known good, and then some named test cases that should evaluate to
/// that known good. e.g.:
/// ```
/// // test suite name known good
///fmt_test!(field_proj_foobar "foo.bar.baz.quux",
/// // test case name should format to known good
/// intermediate_whitespace "foo . bar . baz . quux");
/// ```
macro_rules! fmt_test {
($scope:ident $desired_output:expr, $($name:ident $y:expr),+) => {
fmt_test_inner!($scope $desired_output,
Expand Down

0 comments on commit b6acf0b

Please sign in to comment.