assertables/assert_ends_with/mod.rs
1//! Assert for a sequence that may end with a part.
2//!
3//! These macros help with comparison of a sequence (such as a string, array, range)
4//! and a part (such as a string substring, an array element, a range value).
5//!
6//! * [`assert_ends_with(sequence, subsequence)`](macro@crate::assert_ends_with) ≈ container.contains(containee)
7//!
8//! * [`assert_not_ends_with!(sequence, subsequence)`](macro@crate::assert_not_ends_with) ≈ !container.contains(containee)
9//!
10//!
11//! # Example
12//!
13//! ```rust
14//! use assertables::*;
15//!
16//! // String ends with substring?
17//! let sequence: &str = "alfa";
18//! let subsequence: &str = "fa";
19//! assert_ends_with!(sequence, subsequence);
20//!
21//! // Vector ends with element?
22//! let sequence = vec![1, 2, 3];
23//! let subsequence = [3];
24//! assert_ends_with!(sequence, subsequence);
25//! ```
26
27pub mod assert_ends_with;
28pub mod assert_not_ends_with;