Navigation Menu

Skip to content

Commit

Permalink
work around testling bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Jul 5, 2013
1 parent 5756bd0 commit 45577f6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
10 changes: 9 additions & 1 deletion test/2way.js
@@ -1,4 +1,12 @@
var tape = require('tape')

function log () {
var args = []
for (var i in arguments)
args.push(arguments[i])
console.log(JSON.stringify(args))
}

var d = require('../')

function split(a) {
Expand All @@ -16,7 +24,7 @@ var d = require('../')
d.chunk([a, b], console.log)
assert.deepEqual(_lcs, lcs)
var changes = d.diff(a,b)
console.log('PATCH', changes)
log('PATCH', changes)
var newA = d.patch(a, changes)
assert.deepEqual(newA, b)
assert.end()
Expand Down
9 changes: 8 additions & 1 deletion test/big.js
@@ -1,6 +1,13 @@
var a = require('..')
var tape = require('tape')

function log () {
var args = []
for (var i in arguments)
args.push(arguments[i])
console.log(JSON.stringify(args))
}

function test(n, times) {

tape ('big '+n+'x'+times, function (t) {
Expand Down Expand Up @@ -35,7 +42,7 @@ tape ('big '+n+'x'+times, function (t) {
t.deepEqual(_big, a.patch(big, p, true))
}

console.log('TIME('+n+') = ', n/(Date.now() - start))
log('TIME('+n+') = ', n/(Date.now() - start))
t.end()
})

Expand Down
10 changes: 9 additions & 1 deletion test/test.js
@@ -1,4 +1,12 @@
var tape = require('tape')

function log () {
var args = []
for (var i in arguments)
args.push(arguments[i])
console.log(JSON.stringify(args))
}

var d = require('../')

function split(a) {
Expand Down Expand Up @@ -39,7 +47,7 @@ var d = require('../')
//n-way merge where there is a delete and a false conflict.
//most merges will be only 3 ways, so lets leave that for now.

console.log(d.diff3(split("ABCXYZF"), split("ABDCEF"), split("AXBCEFG")))
log(d.diff3(split("ABCXYZF"), split("ABDCEF"), split("AXBCEFG")))

function assertDiffPatch (a, b) {
tape('assertDiffPatch', function (assert) {
Expand Down
11 changes: 9 additions & 2 deletions test/tree-test.js
@@ -1,5 +1,12 @@
require('tape')('tree-test', function (assert) {

function log () {
var args = []
for (var i in arguments)
args.push(arguments[i])
console.log(JSON.stringify(args))
}

function listify(tree){
var a = []
function cat (b) {
Expand Down Expand Up @@ -53,9 +60,9 @@ diff3 (

function diff3 () {
var args = [].slice.call(arguments).map(listify)
console.log(args)
log(args)
var x = d.diff3.apply(null, args)
console.log('DIFF', x)
log('DIFF', x)
}

assert.end()
Expand Down

0 comments on commit 45577f6

Please sign in to comment.