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:\strawberry -> .appveyor.yml
|
||||
shallow_clone: true
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ class Rachel(pysollib.game.StartDealRowAndCards, RelaxedSpider):
|
|||
# * 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
|
||||
|
||||
|
||||
|
|
|
@ -2474,6 +2474,8 @@ class BasicRowStack(OpenStack):
|
|||
|
||||
# Abstract class.
|
||||
class SequenceRowStack(SequenceStack_StackMethods, BasicRowStack):
|
||||
canMoveCards = OpenStack.canMoveCards
|
||||
|
||||
def __init__(self, x, y, game, **cap):
|
||||
kwdefault(cap, max_move=999999, max_accept=999999)
|
||||
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.
|
||||
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
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ sub myglob
|
|||
);
|
||||
|
||||
my $is_ninja = ( -e "build.ninja" );
|
||||
my $MAKE = $IS_WIN ? 'gmake' : 'make';
|
||||
my $MAKE = $IS_WIN ? 'gmake' : 'make';
|
||||
if ($is_ninja)
|
||||
{
|
||||
system( "ninja", "pretest" );
|
||||
|
|
|
@ -39,17 +39,22 @@ class Mock_S_Game:
|
|||
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
def test_import(self):
|
||||
def _calc_Scorpion_stack(self):
|
||||
g = MockGame()
|
||||
stack = Scorpion_RowStack(0, 0, g)
|
||||
cards = [
|
||||
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:
|
||||
for s, r in [(2, 5), (3, 7), (2, 7), (2, 0), (2, 3), (2, 4), (1, 4)]:
|
||||
c = AbstractCard(1000+r*100+s*10, 0, s, r, g)
|
||||
c.face_up = True
|
||||
c.item = MockItem()
|
||||
stack.addCard(c)
|
||||
return stack
|
||||
|
||||
def test_canMoveCards(self):
|
||||
stack = self._calc_Scorpion_stack()
|
||||
stack.canMoveCards(stack.cards[6:])
|
||||
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