Tests pass! Still havent drawn anything but we are making progress
parent
c9d962df8d
commit
c3bc656435
@ -1,70 +1,51 @@
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_shape_layout_01() {
|
||||
let actual = ShapeLayout(vec![
|
||||
vec![0, 1, 0],
|
||||
vec![1, 1, 1],
|
||||
]).positions();
|
||||
fn test_shape_layout_01a() {
|
||||
let actual = ShapeLayout(vec![vec![0, 1, 0], vec![1, 1, 1]]).positions();
|
||||
|
||||
let expected: [RelativePosition;4] = [
|
||||
(1, 1).into(),
|
||||
(-1, 0).into(),
|
||||
(0, 0).into(),
|
||||
(1, 0).into()
|
||||
];
|
||||
let expected: [RelativePosition; 4] =
|
||||
[(-1, 0).into(), (0, 0).into(), (1, 0).into(), (0, 1).into()];
|
||||
|
||||
debug_assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shape_layout_01b() {
|
||||
let actual = ShapeLayout(vec![vec![1, 0], vec![1, 1], vec![1, 0]]).positions();
|
||||
|
||||
let expected: [RelativePosition; 4] =
|
||||
[(0, -1).into(), (0, 0).into(), (1, 0).into(), (0, 1).into()];
|
||||
|
||||
debug_assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shape_layout_02a() {
|
||||
let actual = ShapeLayout(vec![
|
||||
vec![1],
|
||||
vec![1],
|
||||
vec![1],
|
||||
vec![1],
|
||||
]).positions();
|
||||
let actual = ShapeLayout(vec![vec![1], vec![1], vec![1], vec![1]]).positions();
|
||||
|
||||
let expected: [RelativePosition;4] = [
|
||||
(0, 2).into(),
|
||||
(0, 1).into(),
|
||||
(0, 0).into(),
|
||||
(0, -1).into()
|
||||
];
|
||||
let expected: [RelativePosition; 4] =
|
||||
[(0, -1).into(), (0, 0).into(), (0, 1).into(), (0, 2).into()];
|
||||
|
||||
debug_assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shape_layout_02b() {
|
||||
let actual = ShapeLayout(vec![
|
||||
vec![1, 1, 1, 1],
|
||||
]).positions();
|
||||
let actual = ShapeLayout(vec![vec![1, 1, 1, 1]]).positions();
|
||||
|
||||
let expected: [RelativePosition;4] = [
|
||||
(-1, 0).into(),
|
||||
(0, 0).into(),
|
||||
(0, 1).into(),
|
||||
(0, 2).into()
|
||||
];
|
||||
let expected: [RelativePosition; 4] =
|
||||
[(-1, 0).into(), (0, 0).into(), (1, 0).into(), (2, 0).into()];
|
||||
|
||||
debug_assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shape_layout_03() {
|
||||
let actual = ShapeLayout(vec![
|
||||
vec![1, 1, 0],
|
||||
vec![0, 1, 1],
|
||||
]).positions();
|
||||
let actual = ShapeLayout(vec![vec![1, 1, 0], vec![0, 1, 1]]).positions();
|
||||
|
||||
let expected: [RelativePosition;4] = [
|
||||
(-1, 1).into(),
|
||||
(0, 1).into(),
|
||||
(0, 0).into(),
|
||||
(1, 0).into()
|
||||
];
|
||||
let expected: [RelativePosition; 4] =
|
||||
[(0, 0).into(), (1, 0).into(), (-1, 1).into(), (0, 1).into()];
|
||||
|
||||
debug_assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue