compare.js 369 B

12345678910111213
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var d = new Date();
  4. a.ok(t(12, 3) > 0, "Numbers");
  5. a.ok(t(2, 13) < 0, "Numbers #2");
  6. a.ok(t("aaa", "aa") > 0, "Strings");
  7. a.ok(t("aa", "ab") < 0, "Strings #2");
  8. a(t("aa", "aa"), 0, "Strings same");
  9. a(t(d, new Date(d.getTime())), 0, "Same date");
  10. a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date");
  11. };