Skip to content

Commit 073c32d

Browse files
committed
Write dot before space in line mode.
Closes #153. Fixes #49, #119.
1 parent 47ca717 commit 073c32d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/N3Writer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ N3Writer.prototype = {
109109
return this._encodeIriOrBlank(subject) + ' ' +
110110
this._encodeIriOrBlank(predicate) + ' ' +
111111
this._encodeObject(object) +
112-
(graph && graph.value ? ' ' + this._encodeIriOrBlank(graph) + '.\n' : '.\n');
112+
(graph && graph.value ? ' ' + this._encodeIriOrBlank(graph) + ' .\n' : ' .\n');
113113
},
114114

115115
// ### `quadsToString` serializes an array of quads as a string

test/N3Writer-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ describe('N3Writer', function () {
2424
describe('An N3Writer instance', function () {
2525
it('should serialize a single triple', function () {
2626
var writer = N3Writer();
27-
writer.quadToString(new NamedNode('a'), new NamedNode('b'), new NamedNode('c')).should.equal('<a> <b> <c>.\n');
27+
writer.quadToString(new NamedNode('a'), new NamedNode('b'), new NamedNode('c')).should.equal('<a> <b> <c> .\n');
2828
});
2929

3030
it('should serialize a single quad', function () {
3131
var writer = N3Writer();
32-
writer.quadToString(new NamedNode('a'), new NamedNode('b'), new NamedNode('c'), new NamedNode('g')).should.equal('<a> <b> <c> <g>.\n');
32+
writer.quadToString(new NamedNode('a'), new NamedNode('b'), new NamedNode('c'), new NamedNode('g')).should.equal('<a> <b> <c> <g> .\n');
3333
});
3434

3535
it('should serialize an array of triples', function () {
3636
var writer = N3Writer();
3737
var triples = [new Quad(new NamedNode('a'), new NamedNode('b'), new NamedNode('c')),
3838
new Quad(new NamedNode('d'), new NamedNode('e'), new NamedNode('f'))];
39-
writer.quadsToString(triples).should.equal('<a> <b> <c>.\n<d> <e> <f>.\n');
39+
writer.quadsToString(triples).should.equal('<a> <b> <c> .\n<d> <e> <f> .\n');
4040
});
4141

4242

@@ -514,7 +514,7 @@ describe('N3Writer', function () {
514514
writer.addQuad(new NamedNode('a'), new NamedNode('b'), new NamedNode('c'));
515515
writer.addQuad(new NamedNode('a'), new NamedNode('b'), new NamedNode('d'));
516516
writer.end(function (error, output) {
517-
output.should.equal('<a> <b> <c>.\n<a> <b> <d>.\n');
517+
output.should.equal('<a> <b> <c> .\n<a> <b> <d> .\n');
518518
done(error);
519519
});
520520
});
@@ -527,7 +527,7 @@ describe('N3Writer', function () {
527527
writer.addQuad(new NamedNode('a'), new NamedNode('b'), new NamedNode('d'), new NamedNode('g'));
528528
writer.end(function (error, output) {
529529
called.should.be.true;
530-
output.should.equal('<a> <b> <c>.\n<a> <b> <d> <g>.\n');
530+
output.should.equal('<a> <b> <c> .\n<a> <b> <d> <g> .\n');
531531
done(error);
532532
});
533533
});

0 commit comments

Comments
 (0)