summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-11 04:09:27 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-11 04:09:27 +0200
commit8b1e09f0257de32213debc4bcfcebfc061d51bb2 (patch)
tree266b46b700f25b347ecbb82b2d181ca7beabf319
parentacc1b64fe7824d1d1de62e0542129daa305a6ebe (diff)
downloadJRummikub-8b1e09f0257de32213debc4bcfcebfc061d51bb2.tar
JRummikub-8b1e09f0257de32213debc4bcfcebfc061d51bb2.zip
Wir haben noch einen classify-Bug gefunden... und behoben
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@412 72836036-5685-4462-b002-a69064685172
-rw-r--r--src/jrummikub/model/StoneSet.java36
-rw-r--r--test/jrummikub/model/StoneSetTest.java268
2 files changed, 138 insertions, 166 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java
index 5412a3a..edd6f3f 100644
--- a/src/jrummikub/model/StoneSet.java
+++ b/src/jrummikub/model/StoneSet.java
@@ -23,7 +23,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Create a new single stone stone set
*
* @param stone
- * single stone of the set
+ * single stone of the set
*/
public StoneSet(Stone stone) {
stones = new ArrayList<Stone>(Collections.singletonList(stone));
@@ -33,7 +33,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Create a stone set from a list of stones
*
* @param stones
- * list of stones to build a set of
+ * list of stones to build a set of
*/
public StoneSet(List<Stone> stones) {
this.stones = new ArrayList<Stone>(stones);
@@ -53,7 +53,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Test for rule conflict within the StoneSet
*
* @param settings
- * GameSettings
+ * GameSettings
*
* @return true when the set is valid according to the rules
*/
@@ -62,11 +62,11 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
}
/**
- * Test for rule conflict within the StoneSet and determine whether the set is
- * a group or a run
+ * Test for rule conflict within the StoneSet and determine whether the set
+ * is a group or a run
*
* @param settings
- * GameSettings
+ * GameSettings
*
* @return GROUP or RUN for valid sets, INVALID otherwise
*/
@@ -84,13 +84,18 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
}
if (nonJoker == -1) {
- if (stones.size() > settings.getHighestValue()) {
+ if (stones.size() > settings.getHighestValue()
+ && stones.size() > settings.getStoneColors().size()) {
return new Pair<Type, Integer>(INVALID, 0);
} else if (stones.size() > settings.getStoneColors().size()) {
- return new Pair<Type, Integer>(RUN,
- (settings.getHighestValue() * (settings.getHighestValue() + 1)) / 2
+ return new Pair<Type, Integer>(
+ RUN,
+ (settings.getHighestValue() * (settings
+ .getHighestValue() + 1))
+ / 2
- (stones.size() - settings.getHighestValue())
- * (stones.size() - settings.getHighestValue() - 1) / 2);
+ * (stones.size() - settings.getHighestValue() - 1)
+ / 2);
} else {
return new Pair<Type, Integer>(GROUP, stones.size()
* settings.getHighestValue());
@@ -113,7 +118,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Test for rule conflict within the StoneSet, assuming we have a run
*
* @param referencePosition
- * position of stone used as reference (any non-joker stone)
+ * position of stone used as reference (any non-joker stone)
* @param settings
*/
private int isValidRun(int referencePosition, GameSettings settings) {
@@ -173,7 +178,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Stone Sets
*
* @param position
- * Splitting {@link Position}
+ * Splitting {@link Position}
* @return A pair of StoneSets, one for each split part
*/
public Pair<StoneSet, StoneSet> splitAt(int position) {
@@ -183,7 +188,8 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
return new Pair<StoneSet, StoneSet>(this, null);
}
StoneSet firstSet = new StoneSet(stones.subList(0, position));
- StoneSet secondSet = new StoneSet(stones.subList(position, stones.size()));
+ StoneSet secondSet = new StoneSet(stones.subList(position,
+ stones.size()));
return new Pair<StoneSet, StoneSet>(firstSet, secondSet);
}
@@ -191,7 +197,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Joins StoneSet to another StoneSet and returns the resulting new StoneSet
*
* @param other
- * StoneSet to be joined to active StoneSet
+ * StoneSet to be joined to active StoneSet
* @return the combined StoneSet
*/
public StoneSet join(StoneSet other) {
@@ -214,7 +220,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable, Serializable {
* Returns the i-th stone of the set (starting with 0)
*
* @param i
- * number of the stone to return
+ * number of the stone to return
* @return the i-th stone
*/
public Stone get(int i) {
diff --git a/test/jrummikub/model/StoneSetTest.java b/test/jrummikub/model/StoneSetTest.java
index b299d2c..aba38a5 100644
--- a/test/jrummikub/model/StoneSetTest.java
+++ b/test/jrummikub/model/StoneSetTest.java
@@ -26,6 +26,7 @@ public class StoneSetTest {
private GameSettings lowerValueSettings = new GameSettings();
private GameSettings noLimitsSettings = new GameSettings();
private GameSettings noLimitsLowerValueSettings = new GameSettings();
+ private GameSettings moreColorLowerValueSettings = new GameSettings();
/** */
@Before
@@ -38,6 +39,9 @@ public class StoneSetTest {
noLimitsSettings.setNoLimits(true);
noLimitsLowerValueSettings.setHighestValue(10);
noLimitsLowerValueSettings.setNoLimits(true);
+ moreColorLowerValueSettings.setStoneColors(EnumSet
+ .allOf(StoneColor.class));
+ moreColorLowerValueSettings.setHighestValue(5);
}
private void assertSet(StoneSet.Type expectedType, Integer expectedValue,
@@ -53,29 +57,22 @@ public class StoneSetTest {
public void doubleJokerValid() {
// 3 Stones
// JJZ
- assertSet(GROUP, 3,
- Arrays.asList(new Stone(RED), new Stone(BLACK), new Stone(1, BLACK)),
- defaultSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(RED), new Stone(BLACK),
+ new Stone(1, BLACK)), defaultSettings);
// JZJ
- assertSet(GROUP, 3,
- Arrays.asList(new Stone(RED), new Stone(1, BLACK), new Stone(BLACK)),
- defaultSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(RED), new Stone(1, BLACK),
+ new Stone(BLACK)), defaultSettings);
// ZJJ
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(RED), new Stone(BLACK)),
- defaultSettings);
- assertSet(RUN, 33,
- Arrays.asList(new Stone(10, RED), new Stone(RED), new Stone(BLACK)),
- defaultSettings);
- assertSet(GROUP, 30,
- Arrays.asList(new Stone(10, RED), new Stone(RED), new Stone(BLACK)),
- lowerValueSettings);
- assertSet(GROUP, 39,
- Arrays.asList(new Stone(13, RED), new Stone(RED), new Stone(BLACK)),
- defaultSettings);
- assertSet(RUN, 42,
- Arrays.asList(new Stone(13, RED), new Stone(RED), new Stone(BLACK)),
- higherValueSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(RED),
+ new Stone(BLACK)), defaultSettings);
+ assertSet(RUN, 33, Arrays.asList(new Stone(10, RED), new Stone(RED),
+ new Stone(BLACK)), defaultSettings);
+ assertSet(GROUP, 30, Arrays.asList(new Stone(10, RED), new Stone(RED),
+ new Stone(BLACK)), lowerValueSettings);
+ assertSet(GROUP, 39, Arrays.asList(new Stone(13, RED), new Stone(RED),
+ new Stone(BLACK)), defaultSettings);
+ assertSet(RUN, 42, Arrays.asList(new Stone(13, RED), new Stone(RED),
+ new Stone(BLACK)), higherValueSettings);
// 4 Stones
// JJZZ
assertSet(GROUP, 4, Arrays.asList(new Stone(RED), new Stone(BLACK),
@@ -85,8 +82,9 @@ public class StoneSetTest {
// ZZJJ
assertSet(RUN, 10, Arrays.asList(new Stone(1, RED), new Stone(2, RED),
new Stone(BLACK), new Stone(RED)), defaultSettings);
- assertSet(GROUP, 4, Arrays.asList(new Stone(1, RED), new Stone(1, BLACK),
- new Stone(BLACK), new Stone(RED)), defaultSettings);
+ assertSet(GROUP, 4, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLACK), new Stone(BLACK), new Stone(RED)),
+ defaultSettings);
// ZJZJ
assertSet(GROUP, 4, Arrays.asList(new Stone(1, RED), new Stone(BLACK),
new Stone(1, BLACK), new Stone(RED)), defaultSettings);
@@ -108,100 +106,81 @@ public class StoneSetTest {
assertSet(RUN, 10, Arrays.asList(new Stone(1, RED), new Stone(RED),
new Stone(BLACK), new Stone(4, RED)), defaultSettings);
// More than 4 stones
- assertSet(GROUP, 6, Arrays.asList(new Stone(1, RED), new Stone(1, BLUE),
- new Stone(1, GREEN), new Stone(1, BLACK), new Stone(BLACK), new Stone(
- RED)), moreColorSettings);
+ assertSet(GROUP, 6, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLUE), new Stone(1, GREEN), new Stone(1, BLACK),
+ new Stone(BLACK), new Stone(RED)), moreColorSettings);
}
/** */
@Test
public void groups() {
- assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED), new Stone(1, BLACK),
- new Stone(1, BLUE)), defaultSettings);
- assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED), new Stone(1, BLACK),
- new Stone(1, BLUE)), lessColorSettings);
- assertSet(GROUP, 4, Arrays.asList(new Stone(1, RED), new Stone(1, BLACK),
- new Stone(1, BLUE), new Stone(1, ORANGE)), defaultSettings);
- assertSet(GROUP, 6, Arrays.asList(new Stone(1, RED), new Stone(1, GREEN),
- new Stone(1, GRAY), new Stone(1, BLACK), new Stone(1, BLUE), new Stone(
- 1, ORANGE)), moreColorSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLACK), new Stone(1, BLUE)), defaultSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLACK), new Stone(1, BLUE)), lessColorSettings);
+ assertSet(GROUP, 4, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLACK), new Stone(1, BLUE), new Stone(1, ORANGE)),
+ defaultSettings);
+ assertSet(GROUP, 6, Arrays.asList(new Stone(1, RED),
+ new Stone(1, GREEN), new Stone(1, GRAY), new Stone(1, BLACK),
+ new Stone(1, BLUE), new Stone(1, ORANGE)), moreColorSettings);
}
/** */
@Test
public void runs() {
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(2, RED), new Stone(3, RED)),
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(2, RED),
+ new Stone(3, RED)), defaultSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(2, RED),
+ new Stone(3, RED)), lowerValueSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(2, RED),
+ new Stone(3, RED)), higherValueSettings);
+ assertSet(RUN, 22, Arrays.asList(new Stone(4, BLUE),
+ new Stone(5, BLUE), new Stone(6, BLUE), new Stone(7, BLUE)),
defaultSettings);
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(2, RED), new Stone(3, RED)),
- lowerValueSettings);
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(2, RED), new Stone(3, RED)),
- higherValueSettings);
- assertSet(RUN, 22, Arrays.asList(new Stone(4, BLUE), new Stone(5, BLUE),
- new Stone(6, BLUE), new Stone(7, BLUE)), defaultSettings);
- assertSet(RUN, 42, Arrays.asList(new Stone(13, RED), new Stone(14, RED),
- new Stone(15, RED)), higherValueSettings);
+ assertSet(RUN, 42, Arrays.asList(new Stone(13, RED),
+ new Stone(14, RED), new Stone(15, RED)), higherValueSettings);
}
/** */
@Test
public void singleJoker() {
// ZJZ
- assertSet(
- GROUP,
- 3,
- Arrays.asList(new Stone(1, RED), new Stone(BLACK), new Stone(1, BLACK)),
- defaultSettings);
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(RED), new Stone(3, RED)),
- defaultSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED), new Stone(BLACK),
+ new Stone(1, BLACK)), defaultSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(RED),
+ new Stone(3, RED)), defaultSettings);
// JZZ
- assertSet(GROUP, 3,
- Arrays.asList(new Stone(RED), new Stone(1, RED), new Stone(1, BLACK)),
- defaultSettings);
- assertSet(RUN, 6,
- Arrays.asList(new Stone(RED), new Stone(2, RED), new Stone(3, RED)),
- defaultSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(RED), new Stone(1, RED),
+ new Stone(1, BLACK)), defaultSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(RED), new Stone(2, RED),
+ new Stone(3, RED)), defaultSettings);
// ZZJ
- assertSet(
- GROUP,
- 3,
- Arrays.asList(new Stone(1, RED), new Stone(1, BLACK), new Stone(BLACK)),
- defaultSettings);
- assertSet(RUN, 6,
- Arrays.asList(new Stone(1, RED), new Stone(2, RED), new Stone(RED)),
- defaultSettings);
- assertSet(RUN, 39,
- Arrays.asList(new Stone(12, RED), new Stone(13, RED), new Stone(RED)),
- higherValueSettings);
+ assertSet(GROUP, 3, Arrays.asList(new Stone(1, RED),
+ new Stone(1, BLACK), new Stone(BLACK)), defaultSettings);
+ assertSet(RUN, 6, Arrays.asList(new Stone(1, RED), new Stone(2, RED),
+ new Stone(RED)), defaultSettings);
+ assertSet(RUN, 39, Arrays.asList(new Stone(12, RED),
+ new Stone(13, RED), new Stone(RED)), higherValueSettings);
}
@Test
public void noLimitsTest() {
- assertSet(RUN, 16,
- Arrays.asList(new Stone(RED), new Stone(1, RED), new Stone(2, RED)),
- noLimitsSettings);
- assertSet(RUN, 26,
- Arrays.asList(new Stone(12, RED), new Stone(13, RED), new Stone(RED)),
- noLimitsSettings);
- assertSet(RUN, 20,
- Arrays.asList(new Stone(9, RED), new Stone(10, RED), new Stone(RED)),
- noLimitsLowerValueSettings);
+ assertSet(RUN, 16, Arrays.asList(new Stone(RED), new Stone(1, RED),
+ new Stone(2, RED)), noLimitsSettings);
+ assertSet(RUN, 26, Arrays.asList(new Stone(12, RED),
+ new Stone(13, RED), new Stone(RED)), noLimitsSettings);
+ assertSet(RUN, 20, Arrays.asList(new Stone(9, RED), new Stone(10, RED),
+ new Stone(RED)), noLimitsLowerValueSettings);
assertSet(RUN, 28, Arrays.asList(new Stone(RED), new Stone(BLACK),
new Stone(1, RED), new Stone(2, RED)), noLimitsSettings);
- assertSet(RUN, 26, Arrays.asList(new Stone(12, RED), new Stone(13, RED),
- new Stone(1, RED)), noLimitsSettings);
- assertSet(
- RUN,
- 16,
- Arrays.asList(new Stone(13, RED), new Stone(1, RED), new Stone(2, RED)),
- noLimitsSettings);
+ assertSet(RUN, 26, Arrays.asList(new Stone(12, RED),
+ new Stone(13, RED), new Stone(1, RED)), noLimitsSettings);
+ assertSet(RUN, 16, Arrays.asList(new Stone(13, RED), new Stone(1, RED),
+ new Stone(2, RED)), noLimitsSettings);
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(13, RED), new Stone(RED), new Stone(1, RED)),
- noLimitsSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(13, RED), new Stone(RED),
+ new Stone(1, RED)), noLimitsSettings);
}
// invalid
@@ -211,87 +190,69 @@ public class StoneSetTest {
assertSet(INVALID, 0, Arrays.asList(new Stone(RED), new Stone(BLACK),
new Stone(1, BLACK), new Stone(1, RED)), lessColorSettings);
// More than 4 stones
- assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1, BLUE),
- new Stone(1, GREEN), new Stone(1, BLACK), new Stone(1, VIOLET),
- new Stone(1, ORANGE), new Stone(1, AQUA), new Stone(BLACK), new Stone(
- RED)), moreColorSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1,
+ BLUE), new Stone(1, GREEN), new Stone(1, BLACK), new Stone(1,
+ VIOLET), new Stone(1, ORANGE), new Stone(1, AQUA), new Stone(
+ BLACK), new Stone(RED)), moreColorSettings);
}
/** */
@Test
public void outOfBounds() {
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(RED), new Stone(1, RED), new Stone(2, RED)),
- defaultSettings);
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(12, RED), new Stone(13, RED), new Stone(RED)),
- defaultSettings);
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(9, RED), new Stone(10, RED), new Stone(RED)),
- lowerValueSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(RED), new Stone(1, RED),
+ new Stone(2, RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(12, RED), new Stone(13,
+ RED), new Stone(RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(9, RED), new Stone(10,
+ RED), new Stone(RED)), lowerValueSettings);
assertSet(INVALID, 0, Arrays.asList(new Stone(RED), new Stone(BLACK),
new Stone(1, RED), new Stone(2, RED)), defaultSettings);
- assertSet(INVALID, 0, Arrays.asList(new Stone(12, RED), new Stone(13, RED),
- new Stone(1, RED)), defaultSettings);
- assertSet(
- INVALID,
- 0,
- Arrays.asList(new Stone(13, RED), new Stone(1, RED), new Stone(2, RED)),
- defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(12, RED), new Stone(13,
+ RED), new Stone(1, RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(13, RED), new Stone(1,
+ RED), new Stone(2, RED)), defaultSettings);
}
/** */
@Test
public void sameColor() {
- assertSet(
- INVALID,
- 0,
- Arrays.asList(new Stone(1, RED), new Stone(1, RED), new Stone(1, BLUE)),
- defaultSettings);
- assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1, BLUE),
- new Stone(1, BLACK), new Stone(1, ORANGE), new Stone(RED)),
- defaultSettings);
- assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1, BLUE),
- new Stone(1, GREEN), new Stone(1, BLACK), new Stone(1, VIOLET),
- new Stone(1, GRAY), new Stone(1, ORANGE), new Stone(1, AQUA),
- new Stone(RED)), moreColorSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED),
+ new Stone(1, RED), new Stone(1, BLUE)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1,
+ BLUE), new Stone(1, BLACK), new Stone(1, ORANGE),
+ new Stone(RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(1, RED), new Stone(1,
+ BLUE), new Stone(1, GREEN), new Stone(1, BLACK), new Stone(1,
+ VIOLET), new Stone(1, GRAY), new Stone(1, ORANGE), new Stone(1,
+ AQUA), new Stone(RED)), moreColorSettings);
}
/** */
@Test
public void incorrectOrder() {
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(4, RED), new Stone(6, RED), new Stone(5, RED)),
- defaultSettings);
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(4, RED), new Stone(6, RED), new Stone(RED)),
- defaultSettings);
- assertSet(INVALID, 0,
- Arrays.asList(new Stone(4, RED), new Stone(RED), new Stone(5, RED)),
- defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED),
+ new Stone(6, RED), new Stone(5, RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED),
+ new Stone(6, RED), new Stone(RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED), new Stone(RED),
+ new Stone(5, RED)), defaultSettings);
}
/** */
@Test
public void otherInvalid() {
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED),
+ new Stone(5, RED), new Stone(7, RED)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED), new Stone(5,
+ BLUE), new Stone(6, RED)), defaultSettings);
assertSet(INVALID, 0,
- Arrays.asList(new Stone(4, RED), new Stone(5, RED), new Stone(7, RED)),
- defaultSettings);
- assertSet(
- INVALID,
- 0,
- Arrays.asList(new Stone(4, RED), new Stone(5, BLUE), new Stone(6, RED)),
- defaultSettings);
- assertSet(INVALID, 0, Arrays.asList(new Stone(4, RED), new Stone(5, RED)),
- defaultSettings);
- assertSet(
- INVALID,
- 0,
- Arrays.asList(new Stone(4, BLUE), new Stone(5, RED), new Stone(6, RED)),
+ Arrays.asList(new Stone(4, RED), new Stone(5, RED)),
defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(4, BLUE), new Stone(5,
+ RED), new Stone(6, RED)), defaultSettings);
// Regression test:
- assertSet(INVALID, 0, Arrays.asList(new Stone(12, ORANGE), new Stone(12,
- BLACK), new Stone(7, BLUE)), defaultSettings);
+ assertSet(INVALID, 0, Arrays.asList(new Stone(12, ORANGE), new Stone(
+ 12, BLACK), new Stone(7, BLUE)), defaultSettings);
}
/** */
@@ -302,11 +263,16 @@ public class StoneSetTest {
defaultSettings);
assertSet(GROUP, 4 * 13, Arrays.asList(new Stone(RED), new Stone(RED),
new Stone(RED), new Stone(RED)), defaultSettings);
- assertSet(RUN, 13 + 12 + 11 + 10 + 9, Arrays.asList(new Stone(RED),
- new Stone(RED), new Stone(RED), new Stone(RED), new Stone(RED)),
- defaultSettings);
+ assertSet(RUN, 13 + 12 + 11 + 10 + 9,
+ Arrays.asList(new Stone(RED), new Stone(RED), new Stone(RED),
+ new Stone(RED), new Stone(RED)), defaultSettings);
assertSet(RUN, 5 * 10, Arrays.asList(new Stone(RED), new Stone(RED),
- new Stone(RED), new Stone(RED), new Stone(12, RED)), defaultSettings);
+ new Stone(RED), new Stone(RED), new Stone(12, RED)),
+ defaultSettings);
+ assertSet(GROUP, 6 * 5,
+ Arrays.asList(new Stone(RED), new Stone(RED), new Stone(RED),
+ new Stone(RED), new Stone(RED), new Stone(AQUA)),
+ moreColorLowerValueSettings);
}
/** */