Skip to content

Commit

Permalink
Equals queen
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-moreton committed May 10, 2023
1 parent 2b22b58 commit ccb1e8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ pub fn simple_algebraic_to_pretty_algebraic(fen: &str, move_str: String) -> Opti

if move_str.len() == 5 {
let promotion = move_str.chars().nth(4)?;
alg_notation.push_str(&format!("{}{}", to, piece_to_algebraic[&promotion].to_lowercase()));
alg_notation.push_str(&format!("{}={}", to, piece_to_algebraic[&promotion].to_lowercase()));
} else {
alg_notation.push_str(to);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/fen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ fn it_converts_a_simple_move_to_an_algebraic_move() {
let fen = "6k1/P5p1/1pq1N2p/2p4P/1P1p1RP1/2PKPB2/1r2N3/7N w - - 0 1";
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "f3a8".to_string()), Some(String::from("Ba8")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "c3c4".to_string()), Some(String::from("c4")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "a7a8q".to_string()), Some(String::from("a8q")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "a7a8q".to_string()), Some(String::from("a8=q")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "e2d4".to_string()), Some(String::from("N2xd4")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "h1g3".to_string()), Some(String::from("Nhg3")));
assert_eq!(simple_algebraic_to_pretty_algebraic(fen, "e6c5".to_string()), Some(String::from("Nxc5")));
Expand Down

0 comments on commit ccb1e8c

Please sign in to comment.