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