-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
2,214 additions
and
2,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
var tape = require("tape"), | ||
arrays = require("../"); | ||
const tape = require("tape-await"); | ||
const d3 = require("../"); | ||
|
||
require("./isNaN"); | ||
|
||
tape("ascending(a, b) returns a negative number if a < b", function(test) { | ||
test.ok(arrays.ascending(0, 1) < 0); | ||
test.ok(arrays.ascending("a", "b") < 0); | ||
test.end(); | ||
tape("ascending(a, b) returns a negative number if a < b", (test) => { | ||
test.ok(d3.ascending(0, 1) < 0); | ||
test.ok(d3.ascending("a", "b") < 0); | ||
}); | ||
|
||
tape("ascending(a, b) returns a positive number if a > b", function(test) { | ||
test.ok(arrays.ascending(1, 0) > 0); | ||
test.ok(arrays.ascending("b", "a") > 0); | ||
test.end(); | ||
tape("ascending(a, b) returns a positive number if a > b", (test) => { | ||
test.ok(d3.ascending(1, 0) > 0); | ||
test.ok(d3.ascending("b", "a") > 0); | ||
}); | ||
|
||
tape("ascending(a, b) returns zero if a >= b and a <= b", function(test) { | ||
test.equal(arrays.ascending(0, 0), 0); | ||
test.equal(arrays.ascending("a", "a"), 0); | ||
test.equal(arrays.ascending("0", 0), 0); | ||
test.equal(arrays.ascending(0, "0"), 0); | ||
test.end(); | ||
tape("ascending(a, b) returns zero if a >= b and a <= b", (test) => { | ||
test.equal(d3.ascending(0, 0), 0); | ||
test.equal(d3.ascending("a", "a"), 0); | ||
test.equal(d3.ascending("0", 0), 0); | ||
test.equal(d3.ascending(0, "0"), 0); | ||
}); | ||
|
||
tape("ascending(a, b) returns NaN if a and b are not comparable", function(test) { | ||
test.isNaN(arrays.ascending(0, undefined)); | ||
test.isNaN(arrays.ascending(undefined, 0)); | ||
test.isNaN(arrays.ascending(undefined, undefined)); | ||
test.isNaN(arrays.ascending(0, NaN)); | ||
test.isNaN(arrays.ascending(NaN, 0)); | ||
test.isNaN(arrays.ascending(NaN, NaN)); | ||
test.end(); | ||
tape("ascending(a, b) returns NaN if a and b are not comparable", (test) => { | ||
test.isNaN(d3.ascending(0, undefined)); | ||
test.isNaN(d3.ascending(undefined, 0)); | ||
test.isNaN(d3.ascending(undefined, undefined)); | ||
test.isNaN(d3.ascending(0, NaN)); | ||
test.isNaN(d3.ascending(NaN, 0)); | ||
test.isNaN(d3.ascending(NaN, NaN)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.