Skip to content

Commit

Permalink
bump to tournament@3.0.0 for better serialization safe state management
Browse files Browse the repository at this point in the history
  • Loading branch information
clux committed Oct 11, 2014
1 parent a4054f8 commit 30bf03c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
3.0.0 / 2014-10-11
==================
* Bump tournament to 3.0.0 for better serialization via `::state` and `.restore`

2.1.0 / 2014-10-03
==================
* Implement `_safe` for better `unscorable` check for safe history rewrites
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -23,10 +23,10 @@
},
"dependencies": {
"interlude": "^1.1.0",
"tournament": "^2.2.0"
"tournament": "^3.0.0"
},
"devDependencies": {
"ffa": "^2.1.0",
"ffa": "^3.0.0",
"nodeunit": "^0.9.0",
"jscoverage": "^0.5.5",
"coveralls": "^2.11.1"
Expand Down
8 changes: 0 additions & 8 deletions test/chairs.test.js
Expand Up @@ -45,12 +45,6 @@ exports.chairs = function (t) {
t.equal(trn.matches[3].id.toString(), "R4", "match 3 id");
t.ok(trn.isDone(), "isDone r4");

var ser = trn + '';
var trn2 = Masters.parse(ser);
t.ok(trn2 instanceof Masters, "trn2 is Masters");
t.ok(trn2 instanceof Base, "trn2 is Base");
t.deepEqual(trn2.matches, trn.matches, "matches same");

var res = [
{ seed : 1, wins : 4, pos : 1, against: 0, for : 5+4+3+2 },
{ seed : 2, wins : 3, pos : 2, against: 1+1+1+1, for : 4+3+2+1 },
Expand All @@ -60,7 +54,5 @@ exports.chairs = function (t) {
];

t.deepEqual(trn.results(), res, "results expected");
t.deepEqual(trn2.results(), res, "same as if serialized first");

t.done();
};
19 changes: 0 additions & 19 deletions test/ko.test.js
Expand Up @@ -2,25 +2,6 @@ var $ = require('interlude')
, Masters = require(process.env.MASTERS_COV ? '../masters-cov.js' : '../');

// these tests all cover a simple 10 [2,4,2] setup

exports.serialize = function (t) {
var kos = [2,4,2];
var opts = { knockouts: kos };
t.ok(!Masters.invalid(10, opts), "10 kos not invalid");
var ko = new Masters(10, opts);

for (var i = 0; i < 4; i += 1) {
var konew = Masters.parse(ko + '');
t.deepEqual(ko.matches, konew.matches, "matches the same");
t.deepEqual(ko.kos, konew.kos, "kos the same");

var m = ko.matches[i];
t.ok(ko.score(m.id, $.range(m.p.length).reverse()), "score " + m.id);
t.ok(m.m, "score worked");
}
t.done();
};

exports.score = function (t) {
var kos = [2,4,2];
var opts = { knockouts: kos };
Expand Down

0 comments on commit 30bf03c

Please sign in to comment.