mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Compare commits
5 commits
1fbdc2db98
...
5e10f11ca5
Author | SHA1 | Date | |
---|---|---|---|
|
5e10f11ca5 | ||
|
2b2d23f958 | ||
|
f95a6a5ba8 | ||
|
63ae7a4ffa | ||
|
c0076b5b36 |
5 changed files with 17 additions and 11 deletions
|
@ -65,4 +65,3 @@ cache:
|
||||||
- C:\_P5 -> .appveyor.yml
|
- C:\_P5 -> .appveyor.yml
|
||||||
- C:\strawberry -> .appveyor.yml
|
- C:\strawberry -> .appveyor.yml
|
||||||
shallow_clone: true
|
shallow_clone: true
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ class Rachel(pysollib.game.StartDealRowAndCards, RelaxedSpider):
|
||||||
# * Scorpion Tail - building down by alternate color
|
# * Scorpion Tail - building down by alternate color
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class Scorpion_RowStack(Spider_RowStack, Yukon_SS_RowStack):
|
class Scorpion_RowStack(Yukon_SS_RowStack, Spider_RowStack):
|
||||||
canDropCards = Spider_RowStack.canDropCards
|
canDropCards = Spider_RowStack.canDropCards
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2474,6 +2474,8 @@ class BasicRowStack(OpenStack):
|
||||||
|
|
||||||
# Abstract class.
|
# Abstract class.
|
||||||
class SequenceRowStack(SequenceStack_StackMethods, BasicRowStack):
|
class SequenceRowStack(SequenceStack_StackMethods, BasicRowStack):
|
||||||
|
canMoveCards = OpenStack.canMoveCards
|
||||||
|
|
||||||
def __init__(self, x, y, game, **cap):
|
def __init__(self, x, y, game, **cap):
|
||||||
kwdefault(cap, max_move=999999, max_accept=999999)
|
kwdefault(cap, max_move=999999, max_accept=999999)
|
||||||
BasicRowStack.__init__(self, x, y, game, **cap)
|
BasicRowStack.__init__(self, x, y, game, **cap)
|
||||||
|
|
|
@ -18,7 +18,7 @@ my $abs_bindir = File::Spec->rel2abs($bindir);
|
||||||
|
|
||||||
# Whether to use prove instead of runprove.
|
# Whether to use prove instead of runprove.
|
||||||
my $use_prove = $ENV{FCS_USE_TEST_RUN} ? 0 : 1;
|
my $use_prove = $ENV{FCS_USE_TEST_RUN} ? 0 : 1;
|
||||||
my $num_jobs = $ENV{TEST_JOBS};
|
my $num_jobs = $ENV{TEST_JOBS};
|
||||||
|
|
||||||
sub _is_parallized
|
sub _is_parallized
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ sub myglob
|
||||||
);
|
);
|
||||||
|
|
||||||
my $is_ninja = ( -e "build.ninja" );
|
my $is_ninja = ( -e "build.ninja" );
|
||||||
my $MAKE = $IS_WIN ? 'gmake' : 'make';
|
my $MAKE = $IS_WIN ? 'gmake' : 'make';
|
||||||
if ($is_ninja)
|
if ($is_ninja)
|
||||||
{
|
{
|
||||||
system( "ninja", "pretest" );
|
system( "ninja", "pretest" );
|
||||||
|
|
|
@ -39,17 +39,22 @@ class Mock_S_Game:
|
||||||
|
|
||||||
|
|
||||||
class MyTests(unittest.TestCase):
|
class MyTests(unittest.TestCase):
|
||||||
def test_import(self):
|
def _calc_Scorpion_stack(self):
|
||||||
g = MockGame()
|
g = MockGame()
|
||||||
stack = Scorpion_RowStack(0, 0, g)
|
stack = Scorpion_RowStack(0, 0, g)
|
||||||
cards = [
|
for s, r in [(2, 5), (3, 7), (2, 7), (2, 0), (2, 3), (2, 4), (1, 4)]:
|
||||||
AbstractCard(1000+r*100+s*10, 0, s, r, g)
|
c = AbstractCard(1000+r*100+s*10, 0, s, r, g)
|
||||||
for s, r in [(2, 5), (3, 7), (2, 7), (2, 0),
|
|
||||||
(2, 3), (2, 4), (1, 4)]
|
|
||||||
]
|
|
||||||
for c in cards:
|
|
||||||
c.face_up = True
|
c.face_up = True
|
||||||
c.item = MockItem()
|
c.item = MockItem()
|
||||||
stack.addCard(c)
|
stack.addCard(c)
|
||||||
|
return stack
|
||||||
|
|
||||||
|
def test_canMoveCards(self):
|
||||||
|
stack = self._calc_Scorpion_stack()
|
||||||
stack.canMoveCards(stack.cards[6:])
|
stack.canMoveCards(stack.cards[6:])
|
||||||
self.assertTrue(stack)
|
self.assertTrue(stack)
|
||||||
|
|
||||||
|
def test_canMoveCards_non_top(self):
|
||||||
|
stack = self._calc_Scorpion_stack()
|
||||||
|
self.assertTrue(stack.canMoveCards(stack.cards[4:]))
|
||||||
|
self.assertTrue(stack)
|
||||||
|
|
Loading…
Add table
Reference in a new issue