This repository was archived by the owner on Mar 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathallergies.vader
More file actions
68 lines (54 loc) · 1.82 KB
/
Copy pathallergies.vader
File metadata and controls
68 lines (54 loc) · 1.82 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
"
" Version: 1.0.0
"
Before:
unlet! input expected
Execute (no allergies means not allergic):
let input = 0
AssertEqual 0, AllergicTo(input, 'peanuts')
AssertEqual 0, AllergicTo(input, 'cats')
AssertEqual 0, AllergicTo(input, 'strawberries')
Execute (is allergic to eggs):
let input = 1
AssertEqual 1, AllergicTo(input, 'eggs')
Execute (allergic to eggs in addition to other stuff):
let input = 5
AssertEqual 1, AllergicTo(input, 'eggs')
AssertEqual 1, AllergicTo(input, 'shellfish')
AssertEqual 0, AllergicTo(input, 'strawberries')
Execute (no allergies at all):
let input = 0
let expected = []
AssertEqual expected, List(input)
Execute (allergic to just eggs):
let input = 1
let expected = ['eggs']
AssertEqual expected, List(input)
Execute (allergic to just peanuts):
let input = 2
let expected = ['peanuts']
AssertEqual expected, List(input)
Execute (allergic to just strawberries):
let input = 8
let expected = ['strawberries']
AssertEqual expected, List(input)
Execute (allergic to eggs and peanuts):
let input = 3
let expected = ['eggs', 'peanuts']
AssertEqual expected, List(input)
Execute (allergic to more than eggs but not peanuts):
let input = 5
let expected = ['eggs', 'shellfish']
AssertEqual expected, List(input)
Execute (allergic to lots of stuff):
let input = 248
let expected = ['strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats']
AssertEqual expected, List(input)
Execute (allergic to everything):
let input = 255
let expected = ['eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats']
AssertEqual expected, List(input)
Execute (ignore non allergen score parts):
let input = 509
let expected = ['eggs', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats']
AssertEqual expected, List(input)