-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.json
100 lines (99 loc) · 2.17 KB
/
tests.json
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"version": "1.0.0",
"format": [
{
"title": "allows empty data",
"input": {
"data" : {}
},
"output": "{}"
},
{
"title": "maps one data field",
"input": {
"data" : {
"context": "fake_context"
}
},
"output": "{\"context\":\"fake_context\"}"
},
{
"title": "maps multiple data fields",
"input": {
"data" : {
"level": "WARNING",
"context": "fake_context"
}
},
"output": "{\"context\":\"fake_context\",\"level\":\"WARNING\"}"
},
{
"title": "allows nested objects",
"input": {
"data" : {
"baz": {
"nested": "object"
}
}
},
"output": "{\"baz\":{\"nested\":\"object\"}}"
},
{
"title": "allows spaces",
"input": {
"data" : {
"spaces": " set c"
}
},
"output": "{\"spaces\":\" set c\"}"
},
{
"title": "allows single-quote",
"input": {
"data" : {
"singlequote": "'"
}
},
"output": "{\"singlequote\":\"'\"}"
},
{
"title": "allows double-quote",
"input": {
"data" : {
"doublequote": "\""
}
},
"output": "{\"doublequote\":\"\\\"\"}"
}
],
"formatLog": [
{
"title": "outputs reserved fields",
"input": {
"source": "SOURCE",
"level": "error",
"title": "BAD_THINGS_HAPPENING",
"data": {}
},
"output": "{\"source\":\"SOURCE\",\"level\":\"error\",\"title\":\"BAD_THINGS_HAPPENING\"}"
},
{
"title": "outputs reserved fields and sorted data",
"input": {
"source": "SOURCE",
"level": "error",
"title": "BAD_THINGS_HAPPENING",
"data": {
"foo": "bar",
"baz": "boo"
}
},
"output": "{\"source\":\"SOURCE\",\"level\":\"error\",\"title\":\"BAD_THINGS_HAPPENING\",\"baz\":\"boo\",\"foo\":\"bar\"}"
},
{
"title": "outputs reserved fields, even if undefined",
"input": {},
"output": "{\"source\":\"\",\"level\":\"\",\"title\":\"\"}"
}
]
}