1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
9 require 'games/shogi/piece'
11 class TestShogiPiece < Test::Unit::TestCase
12 def test_type_from_symbol
13 assert_equal :lance, Shogi::Piece.type_from_symbol('L')
14 assert_equal :promoted_silver, Shogi::Piece.type_from_symbol('+S')
15 assert_equal :gold, Shogi::Piece.type_from_symbol('G')
19 assert_equal 'R', Shogi::Piece.symbol(:rook)
20 assert_equal '+B', Shogi::Piece.symbol(:promoted_bishop)
21 assert_equal '+N', Shogi::Piece.symbol(:promoted_horse)
22 assert_equal 'G', Shogi::Piece.symbol(:gold)
26 assert Shogi::Piece.new(:white, :rook).eql?(
27 Shogi::Piece.new(:white, :rook))