Skip to content

Commit d8ed5ff

Browse files
Add tests for namespace examples
1 parent 1b29c37 commit d8ed5ff

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/namespace_examples.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//! Namespace examples.
2+
//!
3+
//! This file has some simple demonstrations of how to use Assertables in
4+
//! validations by using a namespace, explicitly using the macro names.
5+
6+
#[test]
7+
fn test_wildcard_namespace() {
8+
use assertables::*;
9+
assert_starts_with!("alfa", "al");
10+
}
11+
12+
#[test]
13+
fn test_one_macro_namespace() {
14+
use assertables::assert_starts_with;
15+
assert_starts_with!("alfa", "al");
16+
}
17+
18+
#[test]
19+
fn test_two_macro_namespace() {
20+
use assertables::{assert_starts_with, assert_starts_with_as_result};
21+
assert_starts_with!("alfa", "al");
22+
assert!(assert_starts_with_as_result!("alfa", "al").is_ok());
23+
}
24+

0 commit comments

Comments
 (0)