-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpredicates.yaml
More file actions
102 lines (98 loc) · 1.77 KB
/
predicates.yaml
File metadata and controls
102 lines (98 loc) · 1.77 KB
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
101
102
name: "Different predicates"
topic: "core/Repeat"
fixture:
type: 'fbp'
data: |
# @runtime python-example
INPORT=it.IN:IN
OUTPORT=f.OUT:OUT
it(core/Repeat) OUT -> IN f(core/Repeat)
cases:
# equal
-
name: 'equals with correct expect'
assertion: 'should pass'
inputs:
in: true
expect:
out:
equals: true
-
name: 'equals with wrong expect'
assertion: 'should fail'
inputs:
in: true
expect:
out:
equals: false
# above
-
name: 'above with wrong expect'
assertion: 'should fail'
inputs:
in: 1000
expect:
out:
above: 1001
# haveKeys
-
name: 'haveKeys with correct expect'
assertion: 'should pass'
inputs:
in: { foo: 'bar' }
expect:
out:
haveKeys: ['foo']
# type
-
name: 'type with correct expectation'
assertion: 'should pass'
inputs:
in: { foo: 'bar' }
expect:
out:
type: 'object'
# includeKeys
-
name: 'includeKeys with correct expect'
assertion: 'should pass'
inputs:
in: { foo: 'bar', foo2: 'baz' }
expect:
out:
includeKeys: ['foo']
-
name: 'includeKeys with wrong expect'
assertion: 'should fail'
inputs:
in: { foo: 'bar', foo2: 'baz' }
expect:
out:
includeKeys: ['foo', 'foo3']
# contains
-
name: 'contains on string with correct expect'
assertion: 'should pass'
inputs:
in: "my string with a substring 22"
expect:
out:
contains: 'substring'
-
name: 'contains on string with wrong expect'
assertion: 'should fail'
inputs:
in: "my string with a substring 22"
expect:
out:
contains: 'substring 3'
# multiple expectations
-
name: 'multiple expectations on one value, one wrong'
assertion: 'should fail'
inputs:
in: { foo: bar }
expect:
out:
- type: 'object'
- haveKeys: ['nonexist']