Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
059e48cc
Commit
059e48cc
authored
Feb 15, 2016
by
Philipp Wolfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AngularJS check: Added tests for extended formatting syntax.
parent
178f8834
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
weblate/trans/tests/test_angularjs_checks.py
weblate/trans/tests/test_angularjs_checks.py
+14
-2
No files found.
weblate/trans/tests/test_angularjs_checks.py
View file @
059e48cc
...
...
@@ -76,15 +76,27 @@ class AngularJSInterpolationCheckTest(TestCase):
MockUnit
(
'angularjs_wrong_value'
,
flags
=
'angularjs-format'
)
))
def
test_extended_formatting
(
self
):
self
.
assertFalse
(
self
.
check
.
check_single
(
u'Value: {{ something.value | currency }}'
,
u'Wert: {{ something.value | currency }}'
,
MockUnit
(
'angularjs_format'
,
flags
=
'angularjs-format'
)
))
self
.
assertTrue
(
self
.
check
.
check_single
(
u'Value: {{ something.value | currency }}'
,
u'Value: {{ something.value }}'
,
MockUnit
(
'angularjs_format'
,
flags
=
'angularjs-format'
)
))
def
test_check_highlight
(
self
):
highlights
=
self
.
check
.
check_highlight
(
u'{{name}} {{
other
}} string'
,
u'{{name}} {{
something.value | currency
}} string'
,
MockUnit
(
'angularjs_format'
,
flags
=
'angularjs-format'
))
self
.
assertEqual
(
2
,
len
(
highlights
))
self
.
assertEqual
(
0
,
highlights
[
0
][
0
])
self
.
assertEqual
(
8
,
highlights
[
0
][
1
])
self
.
assertEqual
(
9
,
highlights
[
1
][
0
])
self
.
assertEqual
(
18
,
highlights
[
1
][
1
])
self
.
assertEqual
(
41
,
highlights
[
1
][
1
])
def
test_check_highlight_ignored
(
self
):
highlights
=
self
.
check
.
check_highlight
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment