Skip to content

Commit 36f9438

Browse files
committed
Use double quotes in fluent-syntax/test
1 parent 764e698 commit 36f9438

File tree

7 files changed

+176
-176
lines changed

7 files changed

+176
-176
lines changed

fluent-syntax/test/behavior_test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import assert from 'assert';
2-
import { join } from 'path';
3-
import { readdir } from 'fs';
4-
import { readfile } from './util';
5-
import { parse } from '../src';
1+
import assert from "assert";
2+
import { join } from "path";
3+
import { readdir } from "fs";
4+
import { readfile } from "./util";
5+
import { parse } from "../src";
66

7-
const sigil = '^# ~';
8-
const reDirective = new RegExp(`${sigil}(.*)[\n$]`, 'gm');
7+
const sigil = "^# ~";
8+
const reDirective = new RegExp(`${sigil}(.*)[\n$]`, "gm");
99

1010
function* directives(source) {
1111
let match;
@@ -17,16 +17,16 @@ function* directives(source) {
1717
export function preprocess(source) {
1818
return {
1919
directives: [...directives(source)],
20-
source: source.replace(reDirective, ''),
20+
source: source.replace(reDirective, ""),
2121
};
2222
}
2323

2424
function getCodeName(code) {
2525
switch (code[0]) {
26-
case 'E':
26+
case "E":
2727
return `ERROR ${code}`;
2828
default:
29-
throw new Error('Unknown Annotation code');
29+
throw new Error("Unknown Annotation code");
3030
}
3131
}
3232

@@ -41,11 +41,11 @@ export function serializeAnnotation(annot) {
4141
}
4242

4343
if (args.length) {
44-
const prettyArgs = args.map(arg => `"${arg}"`).join(' ');
44+
const prettyArgs = args.map(arg => `"${arg}"`).join(" ");
4545
parts.push(`args ${prettyArgs}`);
4646
}
4747

48-
return parts.join(', ');
48+
return parts.join(", ");
4949
}
5050

5151
function toDirectives(annots, cur) {
@@ -55,28 +55,28 @@ function toDirectives(annots, cur) {
5555
return annots;
5656
}
5757

58-
const fixtures = join(__dirname, 'fixtures_behavior');
58+
const fixtures = join(__dirname, "fixtures_behavior");
5959

6060
readdir(fixtures, function(err, filenames) {
6161
if (err) {
6262
throw err;
6363
}
6464

6565
const ftlnames = filenames.filter(
66-
filename => filename.endsWith('.ftl')
66+
filename => filename.endsWith(".ftl")
6767
);
6868

69-
suite('Behavior tests', function() {
69+
suite("Behavior tests", function() {
7070
for (const filename of ftlnames) {
7171
const filepath = join(fixtures, filename);
7272
test(filename, function() {
7373
return readfile(filepath).then(file => {
7474
const { directives, source } = preprocess(file);
75-
const expected = directives.join('\n') + '\n';
75+
const expected = directives.join("\n") + "\n";
7676
const ast = parse(source);
77-
const actual = ast.body.reduce(toDirectives, []).join('\n') + '\n';
77+
const actual = ast.body.reduce(toDirectives, []).join("\n") + "\n";
7878
assert.deepEqual(
79-
actual, expected, 'Annotations mismatch'
79+
actual, expected, "Annotations mismatch"
8080
);
8181
});
8282
});

fluent-syntax/test/entry_test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import assert from 'assert';
2-
import { ftl } from './util';
1+
import assert from "assert";
2+
import { ftl } from "./util";
33

4-
import { FluentParser, FluentSerializer } from '../src';
4+
import { FluentParser, FluentSerializer } from "../src";
55

6-
suite('Parse entry', function() {
6+
suite("Parse entry", function() {
77
setup(function() {
88
this.parser = new FluentParser({withSpans: false});
99
});
1010

11-
test('simple message', function() {
11+
test("simple message", function() {
1212
const input = ftl`
1313
foo = Foo
1414
`;
@@ -35,7 +35,7 @@ suite('Parse entry', function() {
3535
assert.deepEqual(message, output)
3636
});
3737

38-
test('ignore attached comment', function() {
38+
test("ignore attached comment", function() {
3939
const input = ftl`
4040
# Attached Comment
4141
foo = Foo
@@ -63,7 +63,7 @@ suite('Parse entry', function() {
6363
assert.deepEqual(message, output)
6464
});
6565

66-
test('return junk', function() {
66+
test("return junk", function() {
6767
const input = ftl`
6868
# Attached Comment
6969
junk
@@ -90,7 +90,7 @@ suite('Parse entry', function() {
9090
assert.deepEqual(message, output)
9191
});
9292

93-
test('ignore all valid comments', function() {
93+
test("ignore all valid comments", function() {
9494
const input = ftl`
9595
# Attached Comment
9696
## Group Comment
@@ -120,7 +120,7 @@ suite('Parse entry', function() {
120120
assert.deepEqual(message, output)
121121
});
122122

123-
test('do not ignore invalid comments', function() {
123+
test("do not ignore invalid comments", function() {
124124
const input = ftl`
125125
# Attached Comment
126126
##Invalid Comment
@@ -149,12 +149,12 @@ suite('Parse entry', function() {
149149
});
150150

151151

152-
suite('Serialize entry', function() {
152+
suite("Serialize entry", function() {
153153
setup(function() {
154154
this.serializer = new FluentSerializer();
155155
});
156156

157-
test('simple message', function() {
157+
test("simple message", function() {
158158
const input = {
159159
"comment": null,
160160
"value": {

fluent-syntax/test/reference_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ readdir(fixtures, function(err, filenames) {
6161

6262
assert.deepEqual(
6363
ast, ref,
64-
"Parsed AST doesn\'t match the expected one");
64+
"Parsed AST doesn't match the expected one");
6565
});
6666
}
6767
});

0 commit comments

Comments
 (0)