id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttercoin/buttercoin:lib/logger.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// logger.coffee - Super simple console.logger
// If you want to do fancy logging you can redirect the STDOUT of this process using a UNIX pipe
// Usage
// logger = require('./logger')
// logger.info 'foo bar'
// logger.warn 'baz foo', { 'a': 'b' }
var colo... | #
# logger.coffee - Super simple console.logger
#
# If you want to do fancy logging you can redirect the STDOUT of this process using a UNIX pipe
#
# Usage
#
# logger = require('./logger')
#
# logger.info 'foo bar'
# logger.warn 'baz foo', { 'a': 'b' }
#
#
colors = require('enkicolor')
levels = {
info: 'green',
... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/logger.coffee | MIT | c6eb8f6b9ca6cbea633614875c39b9ba5fc75614 | 663 | https://github.com/buttercoin/buttercoin/blob/c6eb8f6b9ca6cbea633614875c39b9ba5fc75614/lib/logger.coffee | 1 | 29 |
buttercoin/buttercoin:lib/logger.coffee:1:completion | completion | #
# logger.coffee - Super simple console.logger
#
# If you want to do fancy logging you can redirect the STDOUT of this process using a UNIX pipe
#
# Usage
#
# logger = require('./logger')
#
# logger.info 'foo bar'
# logger.warn 'baz foo', { 'a': 'b' }
#
#
colors = require('enkicolor') | levels = {
info: 'green',
data: 'grey',
warn: 'yellow',
error: 'red',
event: 'grey',
exec: 'grey',
help: 'cyan'
}
Object.keys(levels).forEach (level) ->
module.exports[level] = () ->
args = [].slice.call(arguments)
console.log.apply this, [colors[levels[level]](level + ':')].concat(args) | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/logger.coffee | MIT | c6eb8f6b9ca6cbea633614875c39b9ba5fc75614 | 663 | https://github.com/buttercoin/buttercoin/blob/c6eb8f6b9ca6cbea633614875c39b9ba5fc75614/lib/logger.coffee | 1 | 29 |
gss/engine:src/properties/Axioms.coffee:1:raw_corpus | raw_corpus | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 4123fb2412b150c2e5e5f301573d2f440a8be0b3 | 2,854 | https://github.com/gss/engine/blob/4123fb2412b150c2e5e5f301573d2f440a8be0b3/src/properties/Axioms.coffee | 1 | 22 | ||
gss/engine:src/properties/Axioms.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @... | // Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identify(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
var id;
id = this.identify(scope);
return ['... | CoffeeScript | JavaScript | gss/engine | src/properties/Axioms.coffee | MIT | 4123fb2412b150c2e5e5f301573d2f440a8be0b3 | 2,854 | https://github.com/gss/engine/blob/4123fb2412b150c2e5e5f301573d2f440a8be0b3/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identify(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
v... | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | JavaScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 4123fb2412b150c2e5e5f301573d2f440a8be0b3 | 2,854 | https://github.com/gss/engine/blob/4123fb2412b150c2e5e5f301573d2f440a8be0b3/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:completion | completion | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]] | center:
x: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['/', ['get', @getPath(id, 'width')], 2]]
y: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['/', ['get', @getPath(id, 'height')], 2]]
module.exports = Axioms | CoffeeScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 4123fb2412b150c2e5e5f301573d2f440a8be0b3 | 2,854 | https://github.com/gss/engine/blob/4123fb2412b150c2e5e5f301573d2f440a8be0b3/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:raw_corpus | raw_corpus | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 3a8540b2ffe73028d54a041792207f330a705087 | 2,854 | https://github.com/gss/engine/blob/3a8540b2ffe73028d54a041792207f330a705087/src/properties/Axioms.coffee | 1 | 23 | ||
gss/engine:src/properties/Axioms.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @... | // Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identify(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
var id;
id = this.identify(scope);
return ['... | CoffeeScript | JavaScript | gss/engine | src/properties/Axioms.coffee | MIT | 3a8540b2ffe73028d54a041792207f330a705087 | 2,854 | https://github.com/gss/engine/blob/3a8540b2ffe73028d54a041792207f330a705087/src/properties/Axioms.coffee | 1 | 23 |
gss/engine:src/properties/Axioms.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identify(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
v... | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | JavaScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 3a8540b2ffe73028d54a041792207f330a705087 | 2,854 | https://github.com/gss/engine/blob/3a8540b2ffe73028d54a041792207f330a705087/src/properties/Axioms.coffee | 1 | 23 |
gss/engine:src/properties/Axioms.coffee:1:completion | completion | # Known formulas
class Axioms
right: (scope) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]] | center:
x: (scope, path) ->
id = @identify(scope)
return ['+', ['get', @getPath(id, 'x')], ['/', ['get', @getPath(id, 'width')], 2]]
y: (scope, path) ->
debugger
id = @identify(scope)
return ['+', ['get', @getPath(id, 'y')], ['/', ['get', @getPath(id, 'height')], 2]]
module.expor... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 3a8540b2ffe73028d54a041792207f330a705087 | 2,854 | https://github.com/gss/engine/blob/3a8540b2ffe73028d54a041792207f330a705087/src/properties/Axioms.coffee | 1 | 23 |
gss/engine:src/properties/Axioms.coffee:1:raw_corpus | raw_corpus | # Known formulas
class Axioms
right: (scope) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 465ef0255a88915ae4ae7522acb91c4b0d70e60a | 2,854 | https://github.com/gss/engine/blob/465ef0255a88915ae4ae7522acb91c4b0d70e60a/src/properties/Axioms.coffee | 1 | 22 | ||
gss/engine:src/properties/Axioms.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Known formulas
class Axioms
right: (scope) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @... | // Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identity(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
var id;
id = this.identity(scope);
return ['... | CoffeeScript | JavaScript | gss/engine | src/properties/Axioms.coffee | MIT | 465ef0255a88915ae4ae7522acb91c4b0d70e60a | 2,854 | https://github.com/gss/engine/blob/465ef0255a88915ae4ae7522acb91c4b0d70e60a/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identity(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
v... | # Known formulas
class Axioms
right: (scope) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (scope, path) -... | JavaScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 465ef0255a88915ae4ae7522acb91c4b0d70e60a | 2,854 | https://github.com/gss/engine/blob/465ef0255a88915ae4ae7522acb91c4b0d70e60a/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:completion | completion | # Known formulas
class Axioms
right: (scope) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]] | center:
x: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'x')], ['/', ['get', @getPath(id, 'width')], 2]]
y: (scope, path) ->
id = @identity(scope)
return ['+', ['get', @getPath(id, 'y')], ['/', ['get', @getPath(id, 'height')], 2]]
module.exports = Axioms | CoffeeScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 465ef0255a88915ae4ae7522acb91c4b0d70e60a | 2,854 | https://github.com/gss/engine/blob/465ef0255a88915ae4ae7522acb91c4b0d70e60a/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:raw_corpus | raw_corpus | # Known formulas
class Axioms
right: (scope) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (sc... | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/properties/Axioms.coffee | 1 | 22 | ||
gss/engine:src/properties/Axioms.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Known formulas
class Axioms
right: (scope) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'y')... | // Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identity.yield(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
var id;
id = this.identity.yield(scope);
... | CoffeeScript | JavaScript | gss/engine | src/properties/Axioms.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Known formulas
var Axioms;
Axioms = (function() {
class Axioms {
right(scope) {
var id;
id = this.identity.yield(scope);
return ['+', ['get', this.getPath(id, 'x')], ['get', this.getPath(id, 'width')]];
}
bottom(scope, path) {
... | # Known formulas
class Axioms
right: (scope) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]]
center:
x: (sc... | JavaScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/properties/Axioms.coffee | 1 | 22 |
gss/engine:src/properties/Axioms.coffee:1:completion | completion | # Known formulas
class Axioms
right: (scope) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'x')], ['get', @getPath(id, 'width')]]
bottom: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'y')], ['get', @getPath(id, 'height')]] | center:
x: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'x')], ['/', ['get', @getPath(id, 'width')], 2]]
y: (scope, path) ->
id = @identity.yield(scope)
return ['+', ['get', @getPath(id, 'y')], ['/', ['get', @getPath(id, 'height')], 2]]
module.exports ... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Axioms.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/properties/Axioms.coffee | 1 | 22 |
andreyvit/json-diff:test/diff_test.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 1 | 41 | ||
andreyvit/json-diff:test/diff_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical nu... | var Path, assert, diff, diffString, fs;
fs = require('fs');
Path = require('path');
assert = require('assert');
({diff, diffString} = require(`../${process.env.JSLIB || 'lib'}/index`));
describe('diff', function() {
describe('with simple scalar values', function() {
it("should return undefined for two identi... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 1 | 41 |
andreyvit/json-diff:test/diff_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Path, assert, diff, diffString, fs;
fs = require('fs');
Path = require('path');
assert = require('assert');
({diff, diffString} = require(`../${process.env.JSLIB || 'lib'}/index`));
describe('diff', function() {
describe('with simple scalar values', func... | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 1 | 41 |
andreyvit/json-diff:test/diff_test.coffee:1:completion | completion | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | it "should return undefined for two empty objects", ->
assert.deepEqual undefined, diff({ }, { })
it "should return undefined for two objects with identical contents", ->
assert.deepEqual undefined, diff({ foo: 42, bar: 10 }, { foo: 42, bar: 10 })
it "should return undefined for two object hierarc... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 1 | 41 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 43 | 83 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 43 | 83 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 43 | 83 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two arrays with identical array contents including 'null'", ->
assert.deepEqual undefined... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 43 | 83 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", ->
assert.deepEqual [[' '],[ '+', { name: 'Foo', a: 3, b: 1, c: 1 }], [' ']], diff([{ "name": "Foo", "a": 3, "b": 1 },{ foo: 10 }], [{ "name": "Foo", "a": 3, "b": 1 },{ "name": "Foo... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 85 | 123 | ||
andreyvit/json-diff:test/diff_test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", ->
assert.deepEqual [[' '],[ '+', { name: 'Foo', a: 3, b: 1, c: 1 }], [' ']], diff([{ "name": "Foo", "a": 3, "b": 1 },{ foo:... | it("should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", function() {
return assert.deepEqual([
[' '],
[
'+',
{
name: 'Foo',
a: 3,
b: 1,
c: 1
}
],
[' ']
], diff([
{
... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 85 | 123 |
andreyvit/json-diff:test/diff_test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", function() {
return assert.deepEqual([
[' '],
[
'+',
{
name: 'Foo',
a: 3,
b: 1,
... | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", ->
assert.deepEqual [[' '],[ '+', { name: 'Foo', a: 3, b: 1, c: 1 }], [' ']], diff([{ "name": "Foo", "a": 3, "b": 1 },{ foo: 10 }], [{ "name": "Foo", "a": 3, "b": 1 },{ "name": "Foo... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 85 | 123 |
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has a new but nearly identical object added", ->
assert.deepEqual [[' '],[ '+', { name: 'Foo', a: 3, b: 1, c: 1 }], [' ']], diff([{ "name": "Foo", "a": 3, "b": 1 },{ foo: 10 }], [{ "name": "Foo", "a": 3, "b": 1 },{ "name": "Foo... | describe 'with objects', ->
it "should return undefined for two empty objects", ->
assert.deepEqual undefined, diff({ }, { }, {keysOnly: true})
it "should return undefined for two objects with identical contents", ->
assert.deepEqual undefined, diff({ foo: 42, bar: 10 }, { foo: 42, bar: 10 }, {key... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 85 | 123 |
andreyvit/json-diff:test/diff_test.coffee:4:raw_corpus | raw_corpus | it "should return undefined with a recursive diff for two objects with diffent values for a key", ->
assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
it "should return { <key>: <diff> } with a recursive diff when second object is missing a key... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 125 | 163 | ||
andreyvit/json-diff:test/diff_test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return undefined with a recursive diff for two objects with diffent values for a key", ->
assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
it "should return { <key>: <diff> } ... | it("should return undefined with a recursive diff for two objects with diffent values for a key", function() {
return assert.deepEqual(void 0, diff({
foo: 42,
bar: {
bbbar: 10
}
}, {
foo: 42,
bar: {
bbbar: 12
}
}, {
keysOnly: true
}));
});
it("should return { <key>: <dif... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 125 | 163 |
andreyvit/json-diff:test/diff_test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return undefined with a recursive diff for two objects with diffent values for a key", function() {
return assert.deepEqual(void 0, diff({
foo: 42,
bar: {
bbbar: 10
}
}, {
foo: 42,
bar: {
bbbar: 12
}
}, {
key... | it "should return undefined with a recursive diff for two objects with diffent values for a key", ->
assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
it "should return { <key>: <diff> } with a recursive diff when second object is missing a key... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 125 | 163 |
andreyvit/json-diff:test/diff_test.coffee:4:completion | completion | it "should return undefined with a recursive diff for two objects with diffent values for a key", ->
assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
it "should return { <key>: <diff> } with a recursive diff when second object is missing a key... | it "should return [..., ['+', <added item>]] for two arrays when the second one has an extra value at the end (edge case test)", ->
assert.deepEqual [[' ', 10], [' ', 20], ['+', 30]], diff([10, 20], [10, 20, 30], {keysOnly: true})
describe 'with arrays of objects', ->
it "should return undefined for two a... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 125 | 163 |
andreyvit/json-diff:test/diff_test.coffee:5:raw_corpus | raw_corpus | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", ->
assert.deepEqual [[' '], ['+', { foo: 20 }], [' ']], diff([{ foo: 10 }, { foo: 30 }], [{ foo: 10 }, { foo: 20 }, { foo: 30 }], {keysOnly: true})
it "should return [..., ['~', <diff>], ...] for two a... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 165 | 185 | ||
andreyvit/json-diff:test/diff_test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", ->
assert.deepEqual [[' '], ['+', { foo: 20 }], [' ']], diff([{ foo: 10 }, { foo: 30 }], [{ foo: 10 }, { foo: 20 }, { foo: 30 }], {keysOnly: true})
... | it("should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", function() {
return assert.deepEqual([
[' '],
[
'+',
{
foo: 20
}
],
[' ']
], diff([
{
foo: 10
},
{
foo: 30
}
], [
{
foo: 10
... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 165 | 185 |
andreyvit/json-diff:test/diff_test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", function() {
return assert.deepEqual([
[' '],
[
'+',
{
foo: 20
}
],
[' ']
], diff([
{
foo: 10
},
... | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", ->
assert.deepEqual [[' '], ['+', { foo: 20 }], [' ']], diff([{ foo: 10 }, { foo: 30 }], [{ foo: 10 }, { foo: 20 }, { foo: 30 }], {keysOnly: true})
it "should return [..., ['~', <diff>], ...] for two a... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 165 | 185 |
andreyvit/json-diff:test/diff_test.coffee:5:completion | completion | it "should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value", ->
assert.deepEqual [[' '], ['+', { foo: 20 }], [' ']], diff([{ foo: 10 }, { foo: 30 }], [{ foo: 10 }, { foo: 20 }, { foo: 30 }], {keysOnly: true})
it "should return [..., ['~', <diff>], ...] for two a... | a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 70fd4b2456b6b72a5d94c3b71623a338fce63012 | 1,205 | https://github.com/andreyvit/json-diff/blob/70fd4b2456b6b72a5d94c3b71623a338fce63012/test/diff_test.coffee | 165 | 185 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 43 | 81 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | it "should return undefined for two arrays with identical, empty object contents", ->
assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual [[' '], ['~', { foo: { __old: 20, __new: 21 } }], [' ']], diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar:... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 83 | 121 | ||
andreyvit/json-diff:test/diff_test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual [[' '], ['~', { foo: { __old: 20, __new: 21 } }], [' ']], diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { ... | it("should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", function() {
return assert.deepEqual([
[' '],
[
'~',
{
foo: {
__old: 20,
__new: 21
}
}
],
[' ']
], diff([
{
f... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 83 | 121 |
andreyvit/json-diff:test/diff_test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", function() {
return assert.deepEqual([
[' '],
[
'~',
{
foo: {
__old: 20,
__new: 21
... | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual [[' '], ['~', { foo: { __old: 20, __new: 21 } }], [' ']], diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar:... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 83 | 121 |
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual [[' '], ['~', { foo: { __old: 20, __new: 21 } }], [' ']], diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar:... | it "should return undefined for two empty objects", ->
assert.deepEqual undefined, diff({ }, { }, {keysOnly: true})
it "should return undefined for two objects with identical contents", ->
assert.deepEqual undefined, diff({ foo: 42, bar: 10 }, { foo: 42, bar: 10 }, {keysOnly: true})
it "should ret... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 83 | 121 |
andreyvit/json-diff:test/diff_test.coffee:4:raw_corpus | raw_corpus | it "should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", ->
assert.deepEqual { bar: { bbboz__deleted: 11 } }, diff({ foo: 42, bar: { bbbar: 10, bbboz: 11 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
describe 'with arr... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 123 | 161 | ||
andreyvit/json-diff:test/diff_test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", ->
assert.deepEqual { bar: { bbboz__deleted: 11 } }, diff({ foo: 42, bar: { bbbar: 10, bbboz: 11 }}, { foo: 42, bar... | it("should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", function() {
return assert.deepEqual({
bar: {
bbboz__deleted: 11
}
}, diff({
foo: 42,
bar: {
bbbar: 10,
bbboz: 11
}
}, {
foo: 42,
... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 123 | 161 |
andreyvit/json-diff:test/diff_test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", function() {
return assert.deepEqual({
bar: {
bbboz__deleted: 11
}
}, diff({
foo: 42,
bar: {
... | it "should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", ->
assert.deepEqual { bar: { bbboz__deleted: 11 } }, diff({ foo: 42, bar: { bbbar: 10, bbboz: 11 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
describe 'with arr... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 123 | 161 |
andreyvit/json-diff:test/diff_test.coffee:4:completion | completion | it "should return { <key>: <diff> } with a recursive diff when second object is missing a key and two objects with diffent values for a key", ->
assert.deepEqual { bar: { bbboz__deleted: 11 } }, diff({ foo: 42, bar: { bbbar: 10, bbboz: 11 }}, { foo: 42, bar: { bbbar: 12 }}, {keysOnly: true})
describe 'with arr... | describe 'with arrays of objects', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([{ foo: 10 }, { foo: 20 }, { foo: 30 }], [{ foo: 10 }, { foo: 20 }, { foo: 30 }], {keysOnly: true})
it "should return undefined for two arrays with identical, em... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 123 | 161 |
andreyvit/json-diff:test/diff_test.coffee:5:raw_corpus | raw_corpus | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual undefined, diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar: { bbbar: 92, bbboz: 34 } }], [{ foo: 10, bar: ... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 163 | 180 | ||
andreyvit/json-diff:test/diff_test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual undefined, diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo... | it("should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", function() {
return assert.deepEqual(void 0, diff([
{
foo: 10,
bar: {
bbbar: 10,
bbboz: 11
}
},
{
foo: 20,
bar: {
bbbar: 50,
... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 163 | 180 |
andreyvit/json-diff:test/diff_test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", function() {
return assert.deepEqual(void 0, diff([
{
foo: 10,
bar: {
bbbar: 10,
bbboz: 11
}
}... | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual undefined, diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar: { bbbar: 92, bbboz: 34 } }], [{ foo: 10, bar: ... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 163 | 180 |
andreyvit/json-diff:test/diff_test.coffee:5:completion | completion | it "should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)", ->
assert.deepEqual undefined, diff([{ foo: 10, bar: { bbbar: 10, bbboz: 11 } }, { foo: 20, bar: { bbbar: 50, bbboz: 25 } }, { foo: 30, bar: { bbbar: 92, bbboz: 34 } }], [{ foo: 10, bar: ... | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff')
it "retur... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 90ea71799ea52038fde0686efb666fed69f1b6ef | 1,205 | https://github.com/andreyvit/json-diff/blob/90ea71799ea52038fde0686efb666fed69f1b6ef/test/diff_test.coffee | 163 | 180 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | c0b35930922eb0f78b7a6170b9124f0bf69a9b5f | 1,205 | https://github.com/andreyvit/json-diff/blob/c0b35930922eb0f78b7a6170b9124f0bf69a9b5f/test/diff_test.coffee | 43 | 81 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | c0b35930922eb0f78b7a6170b9124f0bf69a9b5f | 1,205 | https://github.com/andreyvit/json-diff/blob/c0b35930922eb0f78b7a6170b9124f0bf69a9b5f/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | c0b35930922eb0f78b7a6170b9124f0bf69a9b5f | 1,205 | https://github.com/andreyvit/json-diff/blob/c0b35930922eb0f78b7a6170b9124f0bf69a9b5f/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | it "should return undefined for two arrays with identical, empty object contents", ->
assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | c0b35930922eb0f78b7a6170b9124f0bf69a9b5f | 1,205 | https://github.com/andreyvit/json-diff/blob/c0b35930922eb0f78b7a6170b9124f0bf69a9b5f/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 43 | 81 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | it "should return undefined for two arrays with identical, empty object contents", ->
assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42, {keysOnly: true})
it "should return undefined for two identical strings", ->
assert.deepEqual undefined, diff("foo", "foo", {keysOnly: true})
it "should... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 83 | 123 | ||
andreyvit/json-diff:test/diff_test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42, {keysOnly: true})
it "should return undefined for two identical strings", ->
assert.deepEqual undefi... | describe('with simple scalar values', function() {
it("should return undefined for two identical numbers", function() {
return assert.deepEqual(void 0, diff(42, 42, {
keysOnly: true
}));
});
it("should return undefined for two identical strings", function() {
return assert.deepEqual(void 0, diff... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 83 | 123 |
andreyvit/json-diff:test/diff_test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with simple scalar values', function() {
it("should return undefined for two identical numbers", function() {
return assert.deepEqual(void 0, diff(42, 42, {
keysOnly: true
}));
});
it("should return undefined for two identical strings"... | describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42, {keysOnly: true})
it "should return undefined for two identical strings", ->
assert.deepEqual undefined, diff("foo", "foo", {keysOnly: true})
it "should... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 83 | 123 |
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42, {keysOnly: true})
it "should return undefined for two identical strings", ->
assert.deepEqual undefined, diff("foo", "foo", {keysOnly: true})
it "should... | assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10, bbboz: 11 } }, { foo: 42, bar: { bbbar: 10, bbboz: 11 } }, {keysOnly: true})
it "should return { <key>__deleted: <old value> } when the second object is missing a key", ->
assert.deepEqual { foo__deleted: 42 }, diff({ foo: 42, bar: 10 }, { bar: 10... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 83 | 123 |
andreyvit/json-diff:test/diff_test.coffee:4:raw_corpus | raw_corpus | it "should return undefined for two arrays with when an item has been modified", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 42, 30], {keysOnly: true})
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10]... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 125 | 165 | ||
andreyvit/json-diff:test/diff_test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return undefined for two arrays with when an item has been modified", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 42, 30], {keysOnly: true})
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array ... | it("should return undefined for two arrays with when an item has been modified", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 42, 30], {
keysOnly: true
}));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", function() {
r... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 125 | 165 |
andreyvit/json-diff:test/diff_test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return undefined for two arrays with when an item has been modified", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 42, 30], {
keysOnly: true
}));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when... | it "should return undefined for two arrays with when an item has been modified", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 42, 30], {keysOnly: true})
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10]... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 125 | 165 |
andreyvit/json-diff:test/diff_test.coffee:4:completion | completion | it "should return undefined for two arrays with when an item has been modified", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 42, 30], {keysOnly: true})
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10]... | it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]], {keysOnly: true})
it "should return undefined for two arrays with identical, repeated contents", ->
assert.deepEqual undefined, diff([{ a: 1, b: 2 }, { a: 1, b: 2 }], [{ a: ... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 125 | 165 |
andreyvit/json-diff:test/diff_test.coffee:5:raw_corpus | raw_corpus | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff')
it "retur... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 167 | 174 | ||
andreyvit/json-diff:test/diff_test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, ... | it("should produce the expected result for the example JSON files", function() {
return assert.equal(diffString(a, b, {
color: false
}), readExampleFile('result.jsdiff'));
});
it("should produce the expected colored result for the example JSON files", function() {
return assert.equal(diffString(a, b), readEx... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 167 | 174 |
andreyvit/json-diff:test/diff_test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should produce the expected result for the example JSON files", function() {
return assert.equal(diffString(a, b, {
color: false
}), readExampleFile('result.jsdiff'));
});
it("should produce the expected colored result for the example JSON files", func... | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff')
it "retur... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 167 | 174 |
andreyvit/json-diff:test/diff_test.coffee:5:completion | completion | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", -> | assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff')
it "return an empty string when no diff found", ->
assert.equal diffString(a, a), '' | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 02864096ce8e9e7c642e8ffeef38724288322988 | 1,205 | https://github.com/andreyvit/json-diff/blob/02864096ce8e9e7c642e8ffeef38724288322988/test/diff_test.coffee | 167 | 174 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 43 | 81 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | it "should return undefined for two arrays with identical, empty object contents", ->
assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('r... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 83 | 94 | ||
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('r... | it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff')
it "return an empty string when no diff found", ->
assert.equal diffString(a, a), '' | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 9bff743e48fbc8cb41e37dca08462120de7f09fa | 1,205 | https://github.com/andreyvit/json-diff/blob/9bff743e48fbc8cb41e37dca08462120de7f09fa/test/diff_test.coffee | 83 | 94 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 43 | 81 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the ... | describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('with arrays of scalars', function() {
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] fo... | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | describe 'with arrays of scalars', ->
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqu... | it "should return undefined for two arrays with identical, empty object contents", ->
assert.deepEqual undefined, diff([{ }], [{ }])
it "should return undefined for two arrays with identical, empty array contents", ->
assert.deepEqual undefined, diff([[]], [[]])
it "should return undefined for two... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 43 | 81 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | describe 'diffString', ->
readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, c... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 83 | 93 | ||
andreyvit/json-diff:test/diff_test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'diffString', ->
readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the ex... | describe('diffString', function() {
var a, b, readExampleFile;
readExampleFile = function(file) {
return fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8');
};
a = JSON.parse(readExampleFile('a.json'));
b = JSON.parse(readExampleFile('b.json'));
it("should produce the expected result for ... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 83 | 93 |
andreyvit/json-diff:test/diff_test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('diffString', function() {
var a, b, readExampleFile;
readExampleFile = function(file) {
return fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8');
};
a = JSON.parse(readExampleFile('a.json'));
b = JSON.parse(readExampleFile('b... | describe 'diffString', ->
readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, c... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 83 | 93 |
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | describe 'diffString', ->
readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json')) | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff') | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | cfd35d22934d63358420aa343e9a01fa54cd84a8 | 1,205 | https://github.com/andreyvit/json-diff/blob/cfd35d22934d63358420aa343e9a01fa54cd84a8/test/diff_test.coffee | 83 | 93 |
andreyvit/json-diff:test/diff_test.coffee:3:raw_corpus | raw_corpus | readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json'))
it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('r... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 6ba4bae150c94be5706e55ca0838c23aa3c7f887 | 1,205 | https://github.com/andreyvit/json-diff/blob/6ba4bae150c94be5706e55ca0838c23aa3c7f887/test/diff_test.coffee | 83 | 91 | ||
andreyvit/json-diff:test/diff_test.coffee:3:completion | completion | readExampleFile = (file) -> fs.readFileSync(Path.join(__dirname, '../example', file), 'utf8')
a = JSON.parse(readExampleFile('a.json'))
b = JSON.parse(readExampleFile('b.json')) | it "should produce the expected result for the example JSON files", ->
assert.equal diffString(a, b, color: no), readExampleFile('result.jsdiff')
it "should produce the expected colored result for the example JSON files", ->
assert.equal diffString(a, b), readExampleFile('result-colored.jsdiff') | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 6ba4bae150c94be5706e55ca0838c23aa3c7f887 | 1,205 | https://github.com/andreyvit/json-diff/blob/6ba4bae150c94be5706e55ca0838c23aa3c7f887/test/diff_test.coffee | 83 | 91 |
andreyvit/json-diff:test/diff_test.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 1 | 40 | ||
andreyvit/json-diff:test/diff_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical nu... | var Path, assert, diff, diffString, fs;
fs = require('fs');
Path = require('path');
assert = require('assert');
({diff, diffString} = require(`../${process.env.JSLIB || 'lib'}/index`));
describe('diff', function() {
describe('with simple scalar values', function() {
it("should return undefined for two identi... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 1 | 40 |
andreyvit/json-diff:test/diff_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Path, assert, diff, diffString, fs;
fs = require('fs');
Path = require('path');
assert = require('assert');
({diff, diffString} = require(`../${process.env.JSLIB || 'lib'}/index`));
describe('diff', function() {
describe('with simple scalar values', func... | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 1 | 40 |
andreyvit/json-diff:test/diff_test.coffee:1:completion | completion | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | it "should return undefined for two objects with identical contents", ->
assert.deepEqual undefined, diff({ foo: 42, bar: 10 }, { foo: 42, bar: 10 })
it "should return undefined for two object hierarchies with identical contents", ->
assert.deepEqual undefined, diff({ foo: 42, bar: { bbbar: 10, bbboz: ... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 1 | 40 |
andreyvit/json-diff:test/diff_test.coffee:2:raw_corpus | raw_corpus | it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10], ['-', 20], [' ', 30]], diff(... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 42 | 82 | ||
andreyvit/json-diff:test/diff_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
... | it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", function() {
return assert.deepEqual([[' ', 10], ['-... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 42 | 82 |
andreyvit/json-diff:test/diff_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return undefined for two arrays with identical contents", function() {
return assert.deepEqual(void 0, diff([10, 20, 30], [10, 20, 30]));
});
it("should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value",... | it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10], ['-', 20], [' ', 30]], diff(... | JavaScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 42 | 82 |
andreyvit/json-diff:test/diff_test.coffee:2:completion | completion | it "should return undefined for two arrays with identical contents", ->
assert.deepEqual undefined, diff([10, 20, 30], [10, 20, 30])
it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' ', 10], ['-', 20], [' ', 30]], diff(... | it "should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value", ->
assert.deepEqual [[' '], ['-', { foo: 20 }], [' ']], diff([{ foo: 10 }, { foo: 20 }, { foo: 30 }], [{ foo: 10 }, { foo: 30 }])
it "should return [..., ['+', <added item>], ...] for two arrays when... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | fbc52822e7f3432abeb94e7356af8fbfaa969583 | 1,205 | https://github.com/andreyvit/json-diff/blob/fbc52822e7f3432abeb94e7356af8fbfaa969583/test/diff_test.coffee | 42 | 82 |
andreyvit/json-diff:test/diff_test.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical numbers", ->
assert.deepEqual undefined, diff(42, 42)... | CoffeeScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 03ba0195d881b48575b151c294f04485fc55e93e | 1,205 | https://github.com/andreyvit/json-diff/blob/03ba0195d881b48575b151c294f04485fc55e93e/test/diff_test.coffee | 1 | 50 | ||
andreyvit/json-diff:test/diff_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
Path = require 'path'
assert = require 'assert'
{ diff, diffString } = require "../#{process.env.JSLIB or 'lib'}/index"
describe 'diff', ->
describe 'with simple scalar values', ->
it "should return undefined for two identical nu... | var Path, assert, diff, diffString, fs;
fs = require('fs');
Path = require('path');
assert = require('assert');
({diff, diffString} = require(`../${process.env.JSLIB || 'lib'}/index`));
describe('diff', function() {
describe('with simple scalar values', function() {
it("should return undefined for two identi... | CoffeeScript | JavaScript | andreyvit/json-diff | test/diff_test.coffee | MIT | 03ba0195d881b48575b151c294f04485fc55e93e | 1,205 | https://github.com/andreyvit/json-diff/blob/03ba0195d881b48575b151c294f04485fc55e93e/test/diff_test.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.