-
Notifications
You must be signed in to change notification settings - Fork 1
/
thistlethwaite.rs
37 lines (31 loc) · 972 Bytes
/
thistlethwaite.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Thistlethwaite Solver Tests
//
// We only test the Facelet Cube due to performance considerations
//
use cubesim::prelude::*;
use cubesim::{GeoCube, FaceletCube};
use cubesim::solve;
use cubesim::parse_scramble;
#[test]
fn solved_state() {
let cube = FaceletCube::new(3);
assert!(cube.apply_moves(&solve(&cube).unwrap()).is_solved());
}
#[test]
fn single_move() {
let cube = FaceletCube::new(3).apply_move(Move::U(MoveVariant::Standard));
assert!(cube.apply_moves(&solve(&cube).unwrap()).is_solved());
}
#[test]
fn longer_scramble() {
let cube = FaceletCube::new(3).apply_moves(&parse_scramble(String::from("U F R2 D2 B2 L R")));
assert!(cube.apply_moves(&solve(&cube).unwrap()).is_solved());
}
#[test]
fn superflip() {
let cube = FaceletCube::new(3).apply_moves(
&parse_scramble(String::from("U R2 F B R B2 R U2 L B2 R U' D' R2 F R' L B2 U2 F2"))
);
assert!(cube.apply_moves(&solve(&cube).unwrap()).is_solved());
}