1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
suites:
-
name: Formatting values
resources:
-
source: |-
key1 = Value 1
key2 = { $sel ->
[a] A2
*[b] B2
}
key3 = Value { 3 }
key4 = { $sel ->
[a] A{ 4 }
*[b] B{ 4 }
}
key5 =
.a = A5
.b = B5
tests:
-
name: returns the value
asserts:
-
id: key1
value: Value 1
-
name: returns the default variant
asserts:
-
id: key2
value: B2
errors:
-
type: Reference
desc: "Unknown variable: $sel"
-
name: returns the value if it is a pattern
asserts:
-
id: key3
value: Value 3
-
name: returns the default variant if it is a pattern
asserts:
-
id: key4
value: B4
errors:
-
type: Reference
desc: "Unknown variable: $sel"
-
name: returns {???} when trying to format a null value
skip: true
asserts:
-
id: key5
value: "{???}"
errors:
-
type: Reference
desc: "Unknown variable: $sel"
-
name: allows to pass traits directly to bundle.formatPattern
asserts:
-
id: key5
attribute: a
value: "A5"
-
id: key5
attribute: b
value: "B5"