1 unstable release

0.1.0 Sep 17, 2023

#2185 in Procedural macros

Download history 87/week @ 2024-06-22 13/week @ 2024-06-29 1/week @ 2024-07-06 22/week @ 2024-07-13 40/week @ 2024-07-20 97/week @ 2024-07-27 28/week @ 2024-08-03 64/week @ 2024-08-10 25/week @ 2024-08-17 1/week @ 2024-08-24 34/week @ 2024-08-31 31/week @ 2024-09-07 13/week @ 2024-09-14 81/week @ 2024-09-21 57/week @ 2024-09-28

152 downloads per month

MIT license

5KB
73 lines

fixtures

fixtures is a Rust crate which allows developers to run tests against fixture files.

#[cfg(test)]
mod tests {
  use fixtures::fixtures;

  #[fixtures("fixtures/*.txt")]
  fn test(path: &std::path::Path) {
    // This test will be run once for each file matching the glob pattern
  }
}

The above example expands to:

#[cfg(test)]
mod tests {
  use fixtures::fixtures;

  fn test(path: &std::path::Path) {
    // This test will be run once for each file matching the glob pattern
  }

  #[test]
  fn test_one_dot_txt_1() {
    test(::std::path::Path::new("fixtures/one.txt"));
  }

  #[test]
  fn test_two_dot_txt_1() {
    test(::std::path::Path::new("fixtures/two.txt"));
  }

  // ...
}

Dependencies

~300–750KB
~18K SLoC