Skip to content

Instantly share code, notes, and snippets.

@tanriol

tanriol/test.rs Secret

Created May 23, 2017 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanriol/e5239b88963164e59e62a54f49f1921e to your computer and use it in GitHub Desktop.
Save tanriol/e5239b88963164e59e62a54f49f1921e to your computer and use it in GitHub Desktop.
use std::env;
#[test]
fn test_lots_lots_of_rectangles() {
let size: usize = env::var("SIZE").unwrap_or("10".to_string()).parse().unwrap();
let line: String = vec!["+"; size].into_iter().collect();
let lines: Vec<&str> = vec![&line; size];
assert_eq!(count(&lines), (size * (size - 1) / 2).pow(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment