Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove falsy tests #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/blank-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function BlankNode (id) {
}

BlankNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
return other.termType === this.termType && other.value === this.value
}

BlankNode.prototype.termType = 'BlankNode'
Expand Down
2 changes: 1 addition & 1 deletion lib/default-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function DefaultGraph () {
}

DefaultGraph.prototype.equals = function (other) {
return !!other && other.termType === this.termType
return other.termType === this.termType
}

DefaultGraph.prototype.termType = 'DefaultGraph'
Expand Down
2 changes: 1 addition & 1 deletion lib/literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Literal (value, language, datatype) {
}

Literal.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value &&
return other.termType === this.termType && other.value === this.value &&
other.language === this.language && other.datatype.equals(this.datatype)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/named-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function NamedNode (iri) {
}

NamedNode.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
return other.termType === this.termType && other.value === this.value
}

NamedNode.prototype.termType = 'NamedNode'
Expand Down
2 changes: 1 addition & 1 deletion lib/quad.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Quad (subject, predicate, object, graph) {
}

Quad.prototype.equals = function (other) {
return !!other && other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&
return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) &&
other.object.equals(this.object) && other.graph.equals(this.graph)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function Variable (name) {
}

Variable.prototype.equals = function (other) {
return !!other && other.termType === this.termType && other.value === this.value
return other.termType === this.termType && other.value === this.value
}

Variable.prototype.termType = 'Variable'
Expand Down
7 changes: 0 additions & 7 deletions test/blank-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ function runTests (DataFactory) {

assert.equal(term.equals(mock), false)
})

it('should return false if value is falsy', function () {
var id = 'b1'
var term = DataFactory.blankNode(id)

assert.equal(term.equals(null), false)
})
})
})
}
Expand Down
6 changes: 0 additions & 6 deletions test/default-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ function runTests (DataFactory) {

assert.equal(term.equals(mock), false)
})

it('should return false if value is falsy', function () {
var term = DataFactory.defaultGraph()

assert.equal(term.equals(null), false)
})
})
})
}
Expand Down
8 changes: 0 additions & 8 deletions test/literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ function runTests (DataFactory) {

assert.equal(term.equals(mock), false)
})

it('should return false if value is falsy', function () {
var string = 'example'
var language = 'en'
var term = DataFactory.literal(string, language)

assert.equal(term.equals(null), false)
})
})
})
}
Expand Down
7 changes: 0 additions & 7 deletions test/named-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ function runTests (DataFactory) {

assert.equal(term.equals(mock), false)
})

it('should return false if value is falsy', function () {
var iri = 'http://example.org'
var term = DataFactory.namedNode(iri)

assert.equal(term.equals(null), false)
})
})
})
}
Expand Down
10 changes: 0 additions & 10 deletions test/quad.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ function runTests (DataFactory) {

assert.equal(quad1.equals(quad2), false)
})

it('should return false if value is falsy', function () {
var subject = DataFactory.namedNode('http://example.org/subject')
var predicate = DataFactory.namedNode('http://example.org/predicate')
var object = DataFactory.namedNode('http://example.org/object')
var graph = DataFactory.namedNode('http://example.org/graph')
var quad = DataFactory.quad(subject, predicate, object, graph)

assert.equal(quad.equals(null), false)
})
})
})
}
Expand Down
9 changes: 0 additions & 9 deletions test/triple.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ function runTests (DataFactory) {

assert.equal(triple.equals(quad), false)
})

it('should return false if value is falsy', function () {
var subject = DataFactory.namedNode('http://example.org/subject')
var predicate = DataFactory.namedNode('http://example.org/predicate')
var object = DataFactory.namedNode('http://example.org/object')
var triple = DataFactory.triple(subject, predicate, object)

assert.equal(triple.equals(null), false)
})
})
})
}
Expand Down
7 changes: 0 additions & 7 deletions test/variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ function runTests (DataFactory) {

assert.equal(term.equals(mock), false)
})

it('should return false if value is falsy', function () {
var name = 'v'
var term = DataFactory.variable(name)

assert.equal(term.equals(null), false)
})
})
})
}
Expand Down