Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,31 @@ a = 0
# Config.b should be a string
b = ""

"#
);
}

#[test]
fn hinden_doc() {
#[derive(TomlExample, Deserialize, Default, PartialEq, Debug)]
#[allow(dead_code)]
struct Config {
/// Config.a should be a number
// This doc will be hiddend not in the example
a: usize,

// NOTE: This note is only shown in the code
/// Config.b should be a string
b: String,
}
assert_eq!(
Config::toml_example(),
r#"# Config.a should be a number
a = 0

# Config.b should be a string
b = ""

"#
);
}
Expand Down