Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unit tests

  • Loading branch information...
commit 47e235776d197d7a7f2c369ac4ab441ae03ddfda 1 parent 57f4a60
@dandean authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests.js
View
14 tests.js
@@ -0,0 +1,14 @@
+var Uuid = require("./uuid-lib"),
+ Assert = require("assert");
+
+var empty = Uuid.EMPTY,
+ uuid = Uuid.create();
+ raw = Uuid.raw();
+
+Assert.equal('00000000000000000000000000000000', empty, 'Empty UUID is not the correct value.');
+Assert.ok(Uuid.isUuid(empty), "EMPTY should be a valid UUID.");
+Assert.ok(Uuid.isUuid(uuid), "Uuid object should be a valid UUID");
+Assert.ok(Uuid.isUuid(raw), "UUID string should be a valid UUID");
+Assert.ok(uuid instanceof Uuid, "Uuid instance should be instanceof Uuid.");
+Assert.ok((raw instanceof Uuid) == false, "Result of raw() should not be instanceof Uuid.");
+Assert.ok(Object.prototype.toString.call(raw) == '[object String]', "Result of raw() should be a string");
Please sign in to comment.
Something went wrong with that request. Please try again.