Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
clux committed Dec 6, 2015
1 parent b2bba15 commit de7c80d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ test('group', function *(t) {
gsizes.forEach(function (s) {
var grps = group(np, s);
var maxsize = $.maximum($.pluck('length', grps));
t.ok(maxsize <= s, "group sizes <= input size");
t.ok(maxsize <= s, 'group sizes <= input size');

var pls = $.flatten(grps);
t.equal(pls.length, np, "right number of players included");
t.equal(pls.length, np, 'right number of players included');
t.deepEqual($.difference(pls, $.range(np)), []
, "players included once per group");
, 'players included once per group');

if (np % s === 0) {
var gsums = grps.map($.sum);
// sum of seeds must differ by at most number of groups in full groups
t.ok($.minimum(gsums) <= $.maximum(gsums) + grps.length
, "sum of seeds in full groups difference");
, 'sum of seeds in full groups difference');

if ($.even(s)) {
// a group is perfect if groups are full and only filled with pairs!
t.equal($.minimum(gsums), $.maximum(gsums)
, "sum of seeds zero difference in perfect groups");
, 'sum of seeds zero difference in perfect groups');
}
}

if (maxsize < s) {
// group size model was reduced as all groups non-full, so:
// calling group with the gs reduced to maxsize should produce same output
var grpsClone = group(np, maxsize);
var errModel = np + " players, groupsize " + s + " reduced to " + maxsize;
t.deepEqual(grps, grpsClone, "reduced model deterministically: " + errModel);
t.equal(group.minimalGroupSize(np, s), maxsize, "reduce: " + s);
var errModel = np + ' players, groupsize ' + s + ' reduced to ' + maxsize;
t.deepEqual(grps, grpsClone, 'reduced model deterministically: ' + errModel);
t.equal(group.minimalGroupSize(np, s), maxsize, 'reduce: ' + s);
}
});
});
Expand Down

0 comments on commit de7c80d

Please sign in to comment.