3
3
import assert from 'assert' ;
4
4
5
5
import { MessageContext } from '../src/context' ;
6
- import { ftl } from './util' ;
7
6
8
7
suite ( 'Compatibility' , function ( ) {
9
8
suite ( 'browser/preferences/main.ftl' , function ( ) {
@@ -18,12 +17,12 @@ suite('Compatibility', function () {
18
17
19
18
test ( '0.4 syntax' , function ( ) {
20
19
const ctx = new MessageContext ( 'en-US' , { useIsolating : false } ) ;
21
- const parsingErrors = ctx . addMessages ( ftl `
22
- // Variables:
23
- // $num - default value of the \`dom.ipc.processCount\` pref.
24
- default-content-process-count
25
- .label = { $num } (default)
26
- `) ;
20
+ const parsingErrors = ctx . addMessages ( `
21
+ // Variables:
22
+ // $num - default value of the \`dom.ipc.processCount\` pref.
23
+ default-content-process-count
24
+ .label = { $num } (default)
25
+ ` ) ;
27
26
28
27
assert . deepEqual ( parsingErrors , [ ] ) ;
29
28
@@ -42,12 +41,12 @@ suite('Compatibility', function () {
42
41
43
42
test ( '0.5 syntax' , function ( ) {
44
43
const ctx = new MessageContext ( 'en-US' , { useIsolating : false } ) ;
45
- const parsingErrors = ctx . addMessages ( ftl `
46
- # Variables:
47
- # $num - default value of the \`dom.ipc.processCount\` pref.
48
- default-content-process-count =
49
- .label = { $num } (default)
50
- `) ;
44
+ const parsingErrors = ctx . addMessages ( `
45
+ # Variables:
46
+ # $num - default value of the \`dom.ipc.processCount\` pref.
47
+ default-content-process-count =
48
+ .label = { $num } (default)
49
+ ` ) ;
51
50
52
51
assert . deepEqual ( parsingErrors , [
53
52
new SyntaxError ( 'Expected an identifier (starting with [a-zA-Z_])' )
@@ -77,20 +76,20 @@ suite('Compatibility', function () {
77
76
78
77
test ( '0.4 syntax' , function ( ) {
79
78
const ctx = new MessageContext ( 'en-US' , { useIsolating : false } ) ;
80
- const parsingErrors = ctx . addMessages ( ftl `
81
- // This Source Code Form is subject to the terms of the Mozilla Public
82
- // License, v. 2.0. If a copy of the MPL was not distributed with this
83
- // file, You can obtain one at http://mozilla.org/MPL/2.0/.
79
+ const parsingErrors = ctx . addMessages ( `
80
+ // This Source Code Form is subject to the terms of the Mozilla Public
81
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
82
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/.
84
83
85
- [[ Do Not Track ]]
84
+ [[ Do Not Track ]]
86
85
87
- do-not-track-description = Send websites a “Do Not Track” signal
88
- do-not-track-learn-more = Learn more
89
- do-not-track-option-default
90
- .label = Only when using Tracking Protection
91
- do-not-track-option-always
92
- .label = Always
93
- `) ;
86
+ do-not-track-description = Send websites a “Do Not Track” signal
87
+ do-not-track-learn-more = Learn more
88
+ do-not-track-option-default
89
+ .label = Only when using Tracking Protection
90
+ do-not-track-option-always
91
+ .label = Always
92
+ ` ) ;
94
93
95
94
assert . deepEqual ( parsingErrors , [ ] ) ;
96
95
@@ -121,20 +120,20 @@ suite('Compatibility', function () {
121
120
122
121
test ( '0.5 syntax' , function ( ) {
123
122
const ctx = new MessageContext ( 'en-US' , { useIsolating : false } ) ;
124
- const parsingErrors = ctx . addMessages ( ftl `
125
- # This Source Code Form is subject to the terms of the Mozilla Public
126
- # License, v. 2.0. If a copy of the MPL was not distributed with this
127
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
128
-
129
- ## Do Not Track
130
-
131
- do-not-track-description = Send websites a “Do Not Track” signal
132
- do-not-track-learn-more = Learn more
133
- do-not-track-option-default =
134
- .label = Only when using Tracking Protection
135
- do-not-track-option-always =
136
- .label = Always
137
- `) ;
123
+ const parsingErrors = ctx . addMessages ( `
124
+ # This Source Code Form is subject to the terms of the Mozilla Public
125
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
126
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
127
+
128
+ ## Do Not Track
129
+
130
+ do-not-track-description = Send websites a “Do Not Track” signal
131
+ do-not-track-learn-more = Learn more
132
+ do-not-track-option-default =
133
+ .label = Only when using Tracking Protection
134
+ do-not-track-option-always =
135
+ .label = Always
136
+ ` ) ;
138
137
139
138
assert . deepEqual ( parsingErrors , [
140
139
new SyntaxError ( 'Expected an identifier (starting with [a-zA-Z_])' )
0 commit comments