Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a
prove
named function in tests.
Closes #38.
- Loading branch information
1 parent
792d9b2
commit 0ab8249
Showing
7 changed files
with
37 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
### Issue by Issue | ||
|
||
* Use a `prove` named function in tests. #38. | ||
* Remove `require.t.js`. #37. | ||
* Rename main module to `pair.js`. #36. | ||
* Upgrade Proof to 0.0.50. #35. |
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,5 +1,7 @@ | ||
require('proof')(2, function (ok) { | ||
require('proof')(2, prove) | ||
|
||
function prove (assert) { | ||
var pair = require('../..') | ||
ok(pair.compare(new Buffer('a'), new Buffer('z')) < 0, 'less than') | ||
ok(pair.compare(new Buffer('a'), new Buffer('aa')) < 0, 'shorter than') | ||
}) | ||
assert(pair.compare(new Buffer('a'), new Buffer('z')) < 0, 'less than') | ||
assert(pair.compare(new Buffer('a'), new Buffer('aa')) < 0, 'shorter than') | ||
} |
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,4 +1,6 @@ | ||
require('proof')(1, function (equal) { | ||
require('proof')(1, prove) | ||
|
||
function prove (assert) { | ||
var pair = require('../..') | ||
equal(pair.extract({ key: new Buffer('a') }).toString(), 'a', 'extract') | ||
}) | ||
assert(pair.extract({ key: new Buffer('a') }).toString(), 'a', 'extract') | ||
} |
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,10 +1,12 @@ | ||
require('proof')(4, function (equal) { | ||
require('proof')(4, prove) | ||
|
||
function prove (assert) { | ||
var pair = require('../..'), record | ||
record = pair.key('a', 0, [ {}, { keyEncoding: 'utf-8' } ]) | ||
equal(record.value.toString(), 'a', 'value') | ||
equal(record.version, 0, 'version') | ||
assert(record.value.toString(), 'a', 'value') | ||
assert(record.version, 0, 'version') | ||
record = pair.key(new Buffer('a'), 0, [ {}, { keyEncoding: 'utf-8' } ]) | ||
equal(record.value.toString(), 'a', 'value as buffer') | ||
assert(record.value.toString(), 'a', 'value as buffer') | ||
record = pair.key(1, 0, [ {}, { keyEncoding: 'utf-8' } ]) | ||
equal(record.value.toString(), '1', 'value as number') | ||
}) | ||
assert(record.value.toString(), '1', 'value as number') | ||
} |
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,14 +1,16 @@ | ||
require('proof')(5, function (equal) { | ||
require('proof')(5, prove) | ||
|
||
function prove (assert) { | ||
var pair = require('../..'), key, record | ||
key = { value: new Buffer('a'), version: 0 } | ||
equal(pair.serialize.key(key).toString(), '0 a', 'serialize key') | ||
assert(pair.serialize.key(key).toString(), '0 a', 'serialize key') | ||
|
||
record = { key: new Buffer('a'), value: new Buffer('z'), operation: 'put', version: 0 } | ||
equal(pair.serialize.record(record).toString(), '0 put 1 az', 'serialize record') | ||
assert(pair.serialize.record(record).toString(), '0 put 1 az', 'serialize record') | ||
|
||
record = { key: new Buffer('a'), operation: 'del', version: 0 } | ||
equal(pair.serialize.record(record).toString(), '0 del 1 a', 'serialize record deletion') | ||
assert(pair.serialize.record(record).toString(), '0 del 1 a', 'serialize record deletion') | ||
|
||
equal(pair.serializer(record).toString(), '0 del 1 a', 'serializer with record') | ||
equal(pair.serializer(key, true).toString(), '0 a', 'serializer with key') | ||
}) | ||
assert(pair.serializer(record).toString(), '0 del 1 a', 'serializer with record') | ||
assert(pair.serializer(key, true).toString(), '0 a', 'serializer with key') | ||
} |