Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 955e1ea

Browse files
Added: test for escaped characters.
This is to cover the case described at: #3.
1 parent 446bc80 commit 955e1ea

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

‎tests/fixtures/resources/lang/en/messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"number": 123,
44
"parent": {
55
"child": "Mariuzzo"
6-
}
6+
},
7+
"escape": "\"escaped\""
78
}

‎tests/fixtures/resources/lang/en/messages.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
'parent' => [
77
'child' => 'Mariuzzo',
88
],
9+
'escape' => '\'escaped\''
910
];

‎tests/loader.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('laravel-localization-loader', () => {
3434
expect(result).toHaveProperty('string', 'Rubens')
3535
expect(result).toHaveProperty('number', 123)
3636
expect(result).toHaveProperty('parent.child', 'Mariuzzo')
37+
expect(result).toHaveProperty('escape', '\'escaped\'')
3738
})
3839
})
3940
it('should load JSON Laravel translation file', () => {
@@ -45,6 +46,7 @@ describe('laravel-localization-loader', () => {
4546
expect(result).toHaveProperty('string', 'Rubens')
4647
expect(result).toHaveProperty('number', 123)
4748
expect(result).toHaveProperty('parent.child', 'Mariuzzo')
49+
expect(result).toHaveProperty('escape', '\"escaped\"')
4850
})
4951
})
5052
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /