summaryrefslogtreecommitdiffstats
path: root/vendor/mac/src/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/mac/src/test.rs')
-rw-r--r--vendor/mac/src/test.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/mac/src/test.rs b/vendor/mac/src/test.rs
new file mode 100644
index 000000000..1e9858c27
--- /dev/null
+++ b/vendor/mac/src/test.rs
@@ -0,0 +1,24 @@
+//! Macros for writing test suites.
+
+/// Generate a test function `$name` which asserts that `$left` and `$right`
+/// are equal.
+///
+/// # Example
+///
+/// ```
+/// # #[macro_use] extern crate mac;
+/// mod test {
+/// # // doesn't actually run the test :/
+/// test_eq!(two_and_two_is_four, 2 + 2, 4);
+/// }
+/// # fn main() { }
+/// ```
+#[macro_export]
+macro_rules! test_eq {
+ ($name:ident, $left:expr, $right:expr) => {
+ #[test]
+ fn $name() {
+ assert_eq!($left, $right);
+ }
+ }
+}