Skip to content

Commit 49ae83e

Browse files
committed
Landscaper: QUnit2 upgrade
1 parent fe32908 commit 49ae83e

24 files changed

+499
-499
lines changed

can-query-logic-test.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ QUnit.module("can-query-logic");
2727

2828

2929

30-
QUnit.test("union", function() {
30+
QUnit.test("union", function(assert) {
3131
var unionResult = algebra.union({
3232
filter: {
3333
name: "Ramiya"
@@ -38,7 +38,7 @@ QUnit.test("union", function() {
3838
}
3939
});
4040

41-
QUnit.deepEqual(unionResult, {
41+
assert.deepEqual(unionResult, {
4242
filter: {
4343
name: {
4444
$in: ["Ramiya", "Bohdi"]
@@ -47,7 +47,7 @@ QUnit.test("union", function() {
4747
});
4848
});
4949

50-
QUnit.test("difference", function() {
50+
QUnit.test("difference", function(assert) {
5151
var differenceResult = algebra.difference({
5252
filter: {
5353
name: {
@@ -60,7 +60,7 @@ QUnit.test("difference", function() {
6060
}
6161
});
6262

63-
QUnit.deepEqual(differenceResult, {
63+
assert.deepEqual(differenceResult, {
6464
filter: {
6565
name: "Ramiya",
6666
}
@@ -69,7 +69,7 @@ QUnit.test("difference", function() {
6969

7070
});
7171

72-
QUnit.test("subset", function() {
72+
QUnit.test("subset", function(assert) {
7373
var subsetResult = algebra.isSubset({
7474
filter: {
7575
name: "Bohdi"
@@ -82,10 +82,10 @@ QUnit.test("subset", function() {
8282
}
8383
});
8484

85-
QUnit.deepEqual(subsetResult, true);
85+
assert.deepEqual(subsetResult, true);
8686
});
8787

88-
QUnit.test("isMember", function() {
88+
QUnit.test("isMember", function(assert) {
8989
var hasResult = algebra.isMember({
9090
filter: {
9191
name: "Bohdi"
@@ -94,10 +94,10 @@ QUnit.test("isMember", function() {
9494
name: "Bohdi"
9595
});
9696

97-
QUnit.deepEqual(hasResult, true);
97+
assert.deepEqual(hasResult, true);
9898
});
9999

100-
QUnit.test("filterMembers basics", function() {
100+
QUnit.test("filterMembers basics", function(assert) {
101101
var subset = algebra.filterMembers({
102102
filter: {
103103
name: {
@@ -118,7 +118,7 @@ QUnit.test("filterMembers basics", function() {
118118
}
119119
]);
120120

121-
QUnit.deepEqual(subset, [{
121+
assert.deepEqual(subset, [{
122122
name: "Bohdi"
123123
},
124124
{
@@ -150,7 +150,7 @@ QUnit.test("filterMembers basics", function() {
150150
}
151151
]);
152152

153-
QUnit.deepEqual(subset, [{
153+
assert.deepEqual(subset, [{
154154
name: "Payal"
155155
},
156156
{
@@ -160,7 +160,7 @@ QUnit.test("filterMembers basics", function() {
160160
});
161161

162162

163-
QUnit.test("unionMembers basics", function() {
163+
QUnit.test("unionMembers basics", function(assert) {
164164
var union = algebra.unionMembers({
165165
filter: {
166166
name: "Bohdi"
@@ -177,7 +177,7 @@ QUnit.test("unionMembers basics", function() {
177177
id: 2
178178
}, ]);
179179

180-
QUnit.deepEqual(union, [{
180+
assert.deepEqual(union, [{
181181
name: "Bohdi",
182182
id: 1
183183
},
@@ -188,10 +188,10 @@ QUnit.test("unionMembers basics", function() {
188188
]);
189189
});
190190

191-
QUnit.test("count basics", function() {
191+
QUnit.test("count basics", function(assert) {
192192

193-
QUnit.equal(algebra.count({}), Infinity);
194-
QUnit.equal(algebra.count({
193+
assert.equal(algebra.count({}), Infinity);
194+
assert.equal(algebra.count({
195195
page: {
196196
start: 1,
197197
end: 2
@@ -201,7 +201,7 @@ QUnit.test("count basics", function() {
201201

202202
});
203203

204-
QUnit.test('index basics', function() {
204+
QUnit.test('index basics', function(assert) {
205205

206206
var index = algebra.index({
207207
sort: "name"
@@ -221,7 +221,7 @@ QUnit.test('index basics', function() {
221221
}], {
222222
name: "k"
223223
});
224-
equal(index, 2);
224+
assert.equal(index, 2);
225225

226226
index = algebra.index({
227227
sort: "-name"
@@ -241,7 +241,7 @@ QUnit.test('index basics', function() {
241241
}].reverse(), {
242242
name: "k"
243243
});
244-
equal(index, 2);
244+
assert.equal(index, 2);
245245

246246
index = algebra.index({},
247247
[{
@@ -261,7 +261,7 @@ QUnit.test('index basics', function() {
261261
name: "k"
262262
});
263263

264-
equal(index, 0);
264+
assert.equal(index, 0);
265265

266266

267267
index = algebra.index({},
@@ -281,7 +281,7 @@ QUnit.test('index basics', function() {
281281
name: "k"
282282
});
283283

284-
equal(index, undefined, "no value if no id");
284+
assert.equal(index, undefined, "no value if no id");
285285

286286
var TODO_id = canReflect.assignSymbols({}, {
287287
"can.getSchema": function() {
@@ -317,13 +317,13 @@ QUnit.test('index basics', function() {
317317
_id: 2
318318
});
319319

320-
equal(index, 2);
320+
assert.equal(index, 2);
321321

322322
//var algebra = new set.Algebra(set.props.id("id"));
323323

324324
});
325325

326-
QUnit.test("filterMembers with reverse sort", function() {
326+
QUnit.test("filterMembers with reverse sort", function(assert) {
327327
var sortedMembers = algebra.filterMembers({
328328
sort: "-name"
329329
},
@@ -341,7 +341,7 @@ QUnit.test("filterMembers with reverse sort", function() {
341341
name: "s"
342342
}]);
343343

344-
QUnit.deepEqual(sortedMembers,
344+
assert.deepEqual(sortedMembers,
345345
[{
346346
id: 2,
347347
name: "z"
@@ -408,11 +408,11 @@ QUnit.test("Value returned by makeEnum is constructorLike", function(assert) {
408408
assert.ok(pass, "Status is constructor like");
409409
});
410410

411-
QUnit.test("can call low-level APIs from the outside", function() {
411+
QUnit.test("can call low-level APIs from the outside", function(assert) {
412412
var gt1 = new QueryLogic.GreaterThan(1);
413413
var lte1 = new QueryLogic.LessThanEqual(1);
414414

415-
QUnit.equal(QueryLogic.intersection(gt1, lte1), QueryLogic.EMPTY);
415+
assert.equal(QueryLogic.intersection(gt1, lte1), QueryLogic.EMPTY);
416416

417417

418418
var isGtJustinAndGt35 = new QueryLogic.KeysAnd({
@@ -423,6 +423,6 @@ QUnit.test("can call low-level APIs from the outside", function() {
423423
age: new QueryLogic.GreaterThan(25)
424424
});
425425

426-
QUnit.deepEqual(QueryLogic.union(isGtJustinAndGt35, isGt25), isGt25, "fewer clauses");
426+
assert.deepEqual(QueryLogic.union(isGtJustinAndGt35, isGt25), isGt25, "fewer clauses");
427427

428428
});

compat/prop_tests/boolean_test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ QUnit.module("can-set compat props.boolean");
1414
*
1515
*
1616
*/
17-
test('boolean set.difference', function() {
17+
QUnit.test('boolean set.difference', function(assert) {
1818

1919
var prop = props.boolean('completed');
2020

@@ -25,7 +25,7 @@ test('boolean set.difference', function() {
2525
* z ∈ (X / Y) | y.completed = false
2626
*/
2727
var res = set.difference({} , { completed: true }, prop);
28-
deepEqual(res, {completed: false}, "inverse of true");
28+
assert.deepEqual(res, {completed: false}, "inverse of true");
2929

3030
/*
3131
* x ∈ {} | x.completed = true OR x.completed = false
@@ -34,7 +34,7 @@ test('boolean set.difference', function() {
3434
* z ∈ (X / Y) | y.completed = false
3535
*/
3636
res = set.difference({}, { completed: false }, prop);
37-
deepEqual(res, {completed: true} , "inverse of false");
37+
assert.deepEqual(res, {completed: true} , "inverse of false");
3838
});
3939

4040
/*
@@ -44,10 +44,10 @@ test('boolean set.difference', function() {
4444
*
4545
* (X U Y) = c
4646
*/
47-
test('boolean set.union', function(){
47+
QUnit.test('boolean set.union', function(assert) {
4848
var prop = props.boolean('completed');
4949
var res = set.union({completed: false} , { completed: true }, prop);
50-
deepEqual(res, {}, "union of true and false is entire boolean set");
50+
assert.deepEqual(res, {}, "union of true and false is entire boolean set");
5151
});
5252

5353
/*
@@ -69,31 +69,31 @@ test('boolean set.union', function(){
6969
*
7070
* Only requires that one property is always on an element
7171
*/
72-
test('boolean set.intersection', function(){
72+
QUnit.test('boolean set.intersection', function(assert) {
7373
var prop = props.boolean('completed');
7474
var res = set.intersection({foo: "bar"} , { completed: true }, prop);
75-
deepEqual(res, {foo: "bar", completed: true}, "intersection is false (#4)");
75+
assert.deepEqual(res, {foo: "bar", completed: true}, "intersection is false (#4)");
7676
});
7777

7878

79-
test('strings false and true are treated as booleans', function(){
79+
QUnit.test('strings false and true are treated as booleans', function(assert) {
8080
var prop = props.boolean('completed');
8181
var res;
8282

8383
res = set.isSubset({} , { completed: "true" }, prop);
84-
ok(!res, "{} and 'true' not a subset");
84+
assert.ok(!res, "{} and 'true' not a subset");
8585
res = set.isSubset({} , { completed: "false" }, prop);
86-
ok(!res, "{} and 'false' not a subset");
86+
assert.ok(!res, "{} and 'false' not a subset");
8787

8888
res = set.isSubset({ completed: "true" }, {}, prop);
89-
ok(res, "subset");
89+
assert.ok(res, "subset");
9090

9191
res = set.isSubset({ completed: "false" }, {}, prop);
92-
ok(res, "subset");
92+
assert.ok(res, "subset");
9393

9494
res = set.union({completed: 'false'} , { completed: 'true' }, prop);
95-
deepEqual(res, {}, "union of true and false is entire boolean set");
95+
assert.deepEqual(res, {}, "union of true and false is entire boolean set");
9696

9797
res = set.isEqual({completed: false} , { completed: "false" }, prop);
98-
ok(res, "false and 'false'");
98+
assert.ok(res, "false and 'false'");
9999
});

compat/prop_tests/dotNotation_test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ QUnit.module("can-set props.dotNotation");
1212
* x ∈ X | x.n.p = 'IL'
1313
*
1414
*/
15-
test('dotNotation set membership', function() {
15+
QUnit.test('dotNotation set membership', function(assert) {
1616
/*
1717
* For a property 'n.p', with value 'IL'
1818
* x ∈ X | x.n.p == 'IL'
1919
*/
2020
var prop = props.dotNotation('n.p'),
2121
alg = new set.Algebra(prop),
2222
res = alg.isMember({'n.p': 'IL'}, {n:{p:'IL'}});
23-
ok(res, "object with nested property is member of set using dotNotation");
23+
assert.ok(res, "object with nested property is member of set using dotNotation");
2424

2525
/*
2626
* For a property 'n.p', with value 'IL'
2727
* x ∉ X | x.n.p != 'IL'
2828
*/
2929
res = alg.isMember({'n.p': 'IL'}, {n:{p:'MI'}});
30-
ok(res === false, "object with nested property not a member of set using dotNotation");
30+
assert.ok(res === false, "object with nested property not a member of set using dotNotation");
3131

3232
/*
3333
* For a property 'n.p.s', with value 'IL'
@@ -36,10 +36,10 @@ test('dotNotation set membership', function() {
3636
prop = props.dotNotation('n.p.s');
3737
alg = new set.Algebra(prop);
3838
res = alg.isMember({'n.p.s': 'IL'}, {n:{p:{s:'IL'}}});
39-
ok(res, "object with deep nested property is member of set using dotNotation");
39+
assert.ok(res, "object with deep nested property is member of set using dotNotation");
4040
});
4141

42-
test('dotNotation set equality', function() {
42+
QUnit.test('dotNotation set equality', function(assert) {
4343
var prop = props.dotNotation('n.p'),
4444
alg = new set.Algebra(prop),
4545
set1 = {'n.p': 'IL'},
@@ -50,20 +50,20 @@ test('dotNotation set equality', function() {
5050
/*
5151
* {x | x ∈ X, x.n.p == 'IL'} = {y | y ∈ Y, y.n.p == 'IL'}
5252
*/
53-
ok(alg.equal(set1, set2) && alg.equal(set2, set1), "sets with dotNotation properties are equivalent");
53+
assert.ok(alg.equal(set1, set2) && alg.equal(set2, set1), "sets with dotNotation properties are equivalent");
5454

5555
/*
5656
* {x | x ∈ X, x.n.p == 'IL'} != {y | y ∈ Y, y.n.p == 'MI'}
5757
*/
58-
ok(alg.equal(set1, set3) === false, "sets with dotNotation properties are not equivalent");
58+
assert.ok(alg.equal(set1, set3) === false, "sets with dotNotation properties are not equivalent");
5959

6060
/*
6161
* {x | x ∈ X, x.n.p == 'MI'} = {y | y ∈ Y, y.n.p == 'MI'}
6262
*/
63-
ok(alg.equal(set4, set3) === false, "sets with dotNotation properties are equivalent to sets with nested properties");
63+
assert.ok(alg.equal(set4, set3) === false, "sets with dotNotation properties are equivalent to sets with nested properties");
6464
});
6565

66-
test('dotNotation set subset', function() {
66+
QUnit.test('dotNotation set subset', function(assert) {
6767
var alg = new set.Algebra(
6868
props.dotNotation('address.state'),
6969
props.dotNotation('address.city')
@@ -75,20 +75,20 @@ test('dotNotation set subset', function() {
7575
/*
7676
* {x | x ∈ X, x.address.state = 'IL', x.address.city = 'Chicago'} ⊆ {y | y ∈ Y, y.address.state == 'IL'}
7777
*/
78-
ok(alg.subset(set2, set1), "sets with dotNotation property is a subset of another dotNotation set");
78+
assert.ok(alg.subset(set2, set1), "sets with dotNotation property is a subset of another dotNotation set");
7979

8080
/*
8181
* {x | x ∈ X, x.address.state = 'IL', x.address.city = 'Chicago'} ⊆ {y | y ∈ Y, y.address.state == 'IL'}
8282
*/
83-
ok(alg.subset(set3, set1), "sets with nested property notation is a subset of a dotNotation set");
83+
assert.ok(alg.subset(set3, set1), "sets with nested property notation is a subset of a dotNotation set");
8484

8585
/*
8686
* {y | y ∈ Y, y.address.state == 'IL'} ⊆ ξ
8787
*/
88-
ok(alg.subset(set1, {}), "sets with dotNotation properties are subsets of the universal set");
88+
assert.ok(alg.subset(set1, {}), "sets with dotNotation properties are subsets of the universal set");
8989

9090
/*
9191
* ξ ⊄ {y | y ∈ Y, y.address.state == 'IL'}
9292
*/
93-
ok(alg.subset({}, set1) === false, "the universal set is not a subset of a set with dotNotation");
93+
assert.ok(alg.subset({}, set1) === false, "the universal set is not a subset of a set with dotNotation");
9494
});

0 commit comments

Comments
 (0)