Skip to content

Commit 69eec55

Browse files
authored
Merge pull request #375 from stasm/remove-ftl-from-fluent-bundle
Remove the ftl helper from fluent, fluent-syntax
2 parents 2b352f8 + d065f18 commit 69eec55

28 files changed

+246
-354
lines changed

fluent-syntax/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@
4444
],
4545
"engines": {
4646
"node": ">=8.9.0"
47+
},
48+
"devDependencies": {
49+
"@fluent/dedent": "^0.1.0"
4750
}
4851
}

fluent-syntax/test/ast_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
import assert from "assert";
4-
import { ftl } from "./util";
4+
import ftl from "@fluent/dedent";
55
import { FluentParser } from "../src";
66
import * as AST from "../src/ast";
77

@@ -42,14 +42,14 @@ suite("BaseNode.equals", function() {
4242
[1] one
4343
*[other] default
4444
}
45-
`);
45+
`);
4646
const otherRes = this.parser.parse(ftl`
4747
msg = { $val ->
4848
[few] things
4949
*[other] default
5050
[1] one
5151
}
52-
`);
52+
`);
5353
const thisNode = thisRes.body[0];
5454
const otherNode = otherRes.body[0];
5555
assert.strictEqual(thisNode.equals(otherNode), false);
@@ -61,12 +61,12 @@ suite("BaseNode.equals", function() {
6161
msg =
6262
.attr1 = one
6363
.attr2 = two
64-
`);
64+
`);
6565
const otherRes = this.parser.parse(ftl`
6666
msg =
6767
.attr2 = two
6868
.attr1 = one
69-
`);
69+
`);
7070
const thisNode = thisRes.body[0];
7171
const otherNode = otherRes.body[0];
7272
assert.strictEqual(thisNode.equals(otherNode), false);

fluent-syntax/test/entry_test.js

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

44
import { FluentParser, FluentSerializer } from "../src";
55

@@ -11,7 +11,7 @@ suite("Parse entry", function() {
1111
test("simple message", function() {
1212
const input = ftl`
1313
foo = Foo
14-
`;
14+
`;
1515
const output = {
1616
"comment": null,
1717
"value": {
@@ -39,7 +39,7 @@ suite("Parse entry", function() {
3939
const input = ftl`
4040
# Attached Comment
4141
foo = Foo
42-
`;
42+
`;
4343
const output = {
4444
"comment": null,
4545
"value": {
@@ -67,9 +67,9 @@ suite("Parse entry", function() {
6767
const input = ftl`
6868
# Attached Comment
6969
junk
70-
`;
70+
`;
7171
const output = {
72-
"content": "junk\n",
72+
"content": "junk",
7373
"annotations": [
7474
{
7575
"arguments": ["="],
@@ -96,7 +96,7 @@ suite("Parse entry", function() {
9696
## Group Comment
9797
### Resource Comment
9898
foo = Foo
99-
`;
99+
`;
100100
const output = {
101101
"comment": null,
102102
"value": {
@@ -124,9 +124,9 @@ suite("Parse entry", function() {
124124
const input = ftl`
125125
# Attached Comment
126126
##Invalid Comment
127-
`;
127+
`;
128128
const output = {
129-
"content": "##Invalid Comment\n",
129+
"content": "##Invalid Comment",
130130
"annotations": [
131131
{
132132
"arguments": [" "],
@@ -175,7 +175,8 @@ suite("Serialize entry", function() {
175175
};
176176
const output = ftl`
177177
foo = Foo
178-
`;
178+
179+
`;
179180

180181
const message = this.serializer.serializeEntry(input)
181182
assert.deepEqual(message, output)

0 commit comments

Comments
 (0)