trackler 2.2.1.92 → 2.2.1.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/acronym/canonical-data.json +3 -11
  4. data/problem-specifications/exercises/hamming/canonical-data.json +61 -31
  5. data/problem-specifications/exercises/react/canonical-data.json +472 -436
  6. data/tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon +1 -1
  7. data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/SeriesTest.ceylon +1 -1
  8. data/tracks/ceylon/exercises/leap/source/leap/LeapTest.ceylon +1 -1
  9. data/tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon +1 -1
  10. data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon +1 -1
  11. data/tracks/ceylon/exercises/sieve/source/sieve/SieveTest.ceylon +1 -1
  12. data/tracks/common-lisp/config.json +9 -9
  13. data/tracks/crystal/exercises/acronym/spec/acronym_spec.cr +0 -4
  14. data/tracks/crystal/exercises/binary/spec/binary_spec.cr +6 -6
  15. data/tracks/crystal/exercises/forth/spec/forth_spec.cr +48 -32
  16. data/tracks/crystal/exercises/hello-world/spec/hello_world_spec.cr +1 -9
  17. data/tracks/crystal/exercises/pascals-triangle/spec/pascals_triangle_spec.cr +13 -1
  18. data/tracks/crystal/generator/spec/exercise_generator_spec.cr +1 -1
  19. data/tracks/crystal/generator/src/generators/acronym.cr +1 -1
  20. data/tracks/crystal/generator/src/generators/binary.cr +2 -2
  21. data/tracks/crystal/generator/src/generators/flatten_array.cr +1 -1
  22. data/tracks/crystal/generator/src/generators/forth.cr +3 -3
  23. data/tracks/crystal/generator/src/generators/pascals-triangle.cr +11 -4
  24. data/tracks/delphi/exercises/phone-number/uPhoneNumberTests.pas +35 -10
  25. data/tracks/factor/exercises/isogram/README.md +2 -2
  26. data/tracks/fortran/.travis.yml +0 -1
  27. data/tracks/go/exercises/book-store/.meta/gen.go +3 -3
  28. data/tracks/go/exercises/book-store/.meta/hints.md +14 -0
  29. data/tracks/go/exercises/book-store/README.md +17 -1
  30. data/tracks/go/exercises/book-store/cases_test.go +17 -17
  31. data/tracks/go/exercises/book-store/example.go +13 -11
  32. data/tracks/go/exercises/bowling/.meta/gen.go +10 -8
  33. data/tracks/go/exercises/bowling/cases_test.go +2 -2
  34. data/tracks/go/exercises/bracket-push/.meta/gen.go +5 -3
  35. data/tracks/go/exercises/bracket-push/cases_test.go +2 -2
  36. data/tracks/go/exercises/dominoes/.meta/gen.go +7 -3
  37. data/tracks/go/exercises/dominoes/cases_test.go +12 -2
  38. data/tracks/go/exercises/nucleotide-count/.meta/gen.go +87 -0
  39. data/tracks/go/exercises/nucleotide-count/.meta/hints.md +20 -0
  40. data/tracks/go/exercises/nucleotide-count/cases_test.go +39 -0
  41. data/tracks/go/exercises/nucleotide-count/example.go +6 -16
  42. data/tracks/go/exercises/nucleotide-count/nucleotide_count_test.go +16 -93
  43. data/tracks/go/exercises/sum-of-multiples/.meta/gen.go +6 -4
  44. data/tracks/go/exercises/sum-of-multiples/cases_test.go +2 -2
  45. data/tracks/haskell/README.md +6 -5
  46. data/tracks/haskell/config.json +73 -73
  47. data/tracks/haskell/exercises/allergies/{HINTS.md → .meta/hints.md} +0 -0
  48. data/tracks/haskell/exercises/alphametics/{HINTS.md → .meta/hints.md} +0 -0
  49. data/tracks/haskell/exercises/anagram/{HINTS.md → .meta/hints.md} +0 -0
  50. data/tracks/haskell/exercises/bank-account/{HINTS.md → .meta/hints.md} +0 -0
  51. data/tracks/haskell/exercises/beer-song/{HINTS.md → .meta/hints.md} +0 -0
  52. data/tracks/haskell/exercises/binary-search-tree/{HINTS.md → .meta/hints.md} +0 -0
  53. data/tracks/haskell/exercises/bowling/{HINTS.md → .meta/hints.md} +0 -0
  54. data/tracks/haskell/exercises/clock/{HINTS.md → .meta/hints.md} +0 -0
  55. data/tracks/haskell/exercises/custom-set/{HINTS.md → .meta/hints.md} +0 -0
  56. data/tracks/haskell/exercises/food-chain/{HINTS.md → .meta/hints.md} +0 -0
  57. data/tracks/haskell/exercises/forth/{HINTS.md → .meta/hints.md} +0 -0
  58. data/tracks/haskell/exercises/go-counting/{HINTS.md → .meta/hints.md} +0 -0
  59. data/tracks/haskell/exercises/grade-school/{HINTS.md → .meta/hints.md} +0 -0
  60. data/tracks/haskell/exercises/hello-world/{HINTS.md → .meta/hints.md} +0 -0
  61. data/tracks/haskell/exercises/hello-world/package.yaml +1 -1
  62. data/tracks/haskell/exercises/house/{HINTS.md → .meta/hints.md} +0 -0
  63. data/tracks/haskell/exercises/isbn-verifier/README.md +1 -1
  64. data/tracks/haskell/exercises/largest-series-product/package.yaml +1 -1
  65. data/tracks/haskell/exercises/leap/{HINTS.md → .meta/hints.md} +0 -0
  66. data/tracks/haskell/exercises/leap/package.yaml +1 -1
  67. data/tracks/haskell/exercises/linked-list/{HINTS.md → .meta/hints.md} +0 -0
  68. data/tracks/haskell/exercises/matrix/{HINTS.md → .meta/hints.md} +0 -0
  69. data/tracks/haskell/exercises/meetup/{HINTS.md → .meta/hints.md} +0 -0
  70. data/tracks/haskell/exercises/minesweeper/package.yaml +1 -1
  71. data/tracks/haskell/exercises/nth-prime/package.yaml +1 -1
  72. data/tracks/haskell/exercises/nucleotide-count/package.yaml +1 -1
  73. data/tracks/haskell/exercises/octal/{HINTS.md → .meta/hints.md} +0 -0
  74. data/tracks/haskell/exercises/palindrome-products/{HINTS.md → .meta/hints.md} +0 -0
  75. data/tracks/haskell/exercises/parallel-letter-frequency/{HINTS.md → .meta/hints.md} +0 -0
  76. data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -1
  77. data/tracks/haskell/exercises/perfect-numbers/package.yaml +1 -1
  78. data/tracks/haskell/exercises/phone-number/package.yaml +1 -1
  79. data/tracks/haskell/exercises/phone-number/test/Tests.hs +10 -2
  80. data/tracks/haskell/exercises/pig-latin/package.yaml +1 -1
  81. data/tracks/haskell/exercises/queen-attack/{HINTS.md → .meta/hints.md} +0 -0
  82. data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -1
  83. data/tracks/haskell/exercises/robot-name/{HINTS.md → .meta/hints.md} +0 -0
  84. data/tracks/haskell/exercises/robot-simulator/{HINTS.md → .meta/hints.md} +0 -0
  85. data/tracks/haskell/exercises/roman-numerals/{HINTS.md → .meta/hints.md} +0 -0
  86. data/tracks/haskell/exercises/roman-numerals/package.yaml +1 -1
  87. data/tracks/haskell/exercises/rotational-cipher/package.yaml +1 -1
  88. data/tracks/haskell/exercises/saddle-points/package.yaml +1 -1
  89. data/tracks/haskell/exercises/scrabble-score/package.yaml +1 -1
  90. data/tracks/haskell/exercises/secret-handshake/package.yaml +1 -1
  91. data/tracks/haskell/exercises/series/{HINTS.md → .meta/hints.md} +0 -0
  92. data/tracks/haskell/exercises/sgf-parsing/{HINTS.md → .meta/hints.md} +0 -0
  93. data/tracks/haskell/exercises/sieve/package.yaml +1 -1
  94. data/tracks/haskell/exercises/simple-linked-list/{HINTS.md → .meta/hints.md} +0 -0
  95. data/tracks/haskell/exercises/space-age/{HINTS.md → .meta/hints.md} +0 -0
  96. data/tracks/haskell/exercises/space-age/package.yaml +1 -1
  97. data/tracks/haskell/exercises/spiral-matrix/package.yaml +1 -1
  98. data/tracks/haskell/exercises/sublist/{HINTS.md → .meta/hints.md} +0 -0
  99. data/tracks/haskell/exercises/sublist/package.yaml +1 -1
  100. data/tracks/haskell/exercises/trinary/{HINTS.md → .meta/hints.md} +0 -0
  101. data/tracks/haskell/exercises/twelve-days/package.yaml +1 -1
  102. data/tracks/haskell/exercises/word-count/{HINTS.md → .meta/hints.md} +0 -0
  103. data/tracks/haskell/exercises/wordy/{HINTS.md → .meta/hints.md} +0 -0
  104. data/tracks/haskell/exercises/zebra-puzzle/package.yaml +1 -1
  105. data/tracks/java/exercises/phone-number/.meta/src/reference/java/PhoneNumber.java +10 -2
  106. data/tracks/java/exercises/phone-number/.meta/version +1 -0
  107. data/tracks/java/exercises/phone-number/src/test/java/PhoneNumberTest.java +56 -19
  108. data/tracks/purescript/config/exercise_readme.go.tmpl +0 -3
  109. data/tracks/swift/.travis.yml +0 -18
  110. data/tracks/swift/circle.yml +17 -6
  111. metadata +41 -37
  112. data/tracks/purescript/docs/EXERCISE_README_INSERT.md +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f788d6aab478aaf66e348921d374b3e1585973f6
4
- data.tar.gz: 8eb41f39bd9349a8c2d778f7a658efd3d677a918
3
+ metadata.gz: e97ec67bfca10eb667d516f743d6f555611f2cc2
4
+ data.tar.gz: '01340854e48597e11cfbac9018dd7d9ecf7b2395'
5
5
  SHA512:
6
- metadata.gz: 20f227fc28dc75a4d90368dde1a75f73cbf1e277bf79e7164fab5d8eb01307ea519f81aa1a388dbd07b78fdb6d2c86794bf33f3c7e12cb83fd9aff21bd84f402
7
- data.tar.gz: 44ee0515e374fbdf13a258f4e0be701c3df720299604c73277f88e8aefe966466f97ea24654ebfcc7f3e694341d5f83b4421e227ad12bec02c6735cb38b84c2d
6
+ metadata.gz: bdd6bfc70d06fd7084c145e86db492c4a2b8ccb70b7e9456deed587d53ae8c978e40cc822b0455c092aadef17cc05fff1ac3ba5867197bd029d00fe6fe006d19
7
+ data.tar.gz: 4cb7b21baec9d68a22a657e1edd3fc583c708908214c62ab928dec901a197af34db4f245386758ebbcc399965b7a77e8ccb89da0dac6f1dd2f0e4b1deaff6948
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.92"
2
+ VERSION = "2.2.1.93"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "acronym",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "cases": [
5
5
  {
6
6
  "description": "Abbreviate a phrase",
@@ -30,15 +30,7 @@
30
30
  "expected": "FIFO"
31
31
  },
32
32
  {
33
- "description": "all caps words",
34
- "property": "abbreviate",
35
- "input": {
36
- "phrase": "PHP: Hypertext Preprocessor"
37
- },
38
- "expected": "PHP"
39
- },
40
- {
41
- "description": "non-acronym all caps word",
33
+ "description": "all caps word",
42
34
  "property": "abbreviate",
43
35
  "input": {
44
36
  "phrase": "GNU Image Manipulation Program"
@@ -46,7 +38,7 @@
46
38
  "expected": "GIMP"
47
39
  },
48
40
  {
49
- "description": "hyphenated",
41
+ "description": "punctuation without whitespace",
50
42
  "property": "abbreviate",
51
43
  "input": {
52
44
  "phrase": "Complementary metal-oxide semiconductor"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "hamming",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "comments": [
5
5
  "Language implementations vary on the issue of unequal length strands.",
6
6
  "A language may elect to simplify this task by only presenting equal",
@@ -17,106 +17,136 @@
17
17
  {
18
18
  "description": "empty strands",
19
19
  "property": "distance",
20
- "strand1": "",
21
- "strand2": "",
20
+ "input": {
21
+ "strand1": "",
22
+ "strand2": ""
23
+ },
22
24
  "expected": 0
23
25
  },
24
26
  {
25
27
  "description": "identical strands",
26
28
  "property": "distance",
27
- "strand1": "A",
28
- "strand2": "A",
29
+ "input": {
30
+ "strand1": "A",
31
+ "strand2": "A"
32
+ },
29
33
  "expected": 0
30
34
  },
31
35
  {
32
36
  "description": "long identical strands",
33
37
  "property": "distance",
34
- "strand1": "GGACTGA",
35
- "strand2": "GGACTGA",
38
+ "input": {
39
+ "strand1": "GGACTGA",
40
+ "strand2": "GGACTGA"
41
+ },
36
42
  "expected": 0
37
43
  },
38
44
  {
39
45
  "description": "complete distance in single nucleotide strands",
40
46
  "property": "distance",
41
- "strand1": "A",
42
- "strand2": "G",
47
+ "input": {
48
+ "strand1": "A",
49
+ "strand2": "G"
50
+ },
43
51
  "expected": 1
44
52
  },
45
53
  {
46
54
  "description": "complete distance in small strands",
47
55
  "property": "distance",
48
- "strand1": "AG",
49
- "strand2": "CT",
56
+ "input": {
57
+ "strand1": "AG",
58
+ "strand2": "CT"
59
+ },
50
60
  "expected": 2
51
61
  },
52
62
  {
53
63
  "description": "small distance in small strands",
54
64
  "property": "distance",
55
- "strand1": "AT",
56
- "strand2": "CT",
65
+ "input": {
66
+ "strand1": "AT",
67
+ "strand2": "CT"
68
+ },
57
69
  "expected": 1
58
70
  },
59
71
  {
60
72
  "description": "small distance",
61
73
  "property": "distance",
62
- "strand1": "GGACG",
63
- "strand2": "GGTCG",
74
+ "input": {
75
+ "strand1": "GGACG",
76
+ "strand2": "GGTCG"
77
+ },
64
78
  "expected": 1
65
79
  },
66
80
  {
67
81
  "description": "small distance in long strands",
68
82
  "property": "distance",
69
- "strand1": "ACCAGGG",
70
- "strand2": "ACTATGG",
83
+ "input": {
84
+ "strand1": "ACCAGGG",
85
+ "strand2": "ACTATGG"
86
+ },
71
87
  "expected": 2
72
88
  },
73
89
  {
74
90
  "description": "non-unique character in first strand",
75
91
  "property": "distance",
76
- "strand1": "AAG",
77
- "strand2": "AAA",
92
+ "input": {
93
+ "strand1": "AAG",
94
+ "strand2": "AAA"
95
+ },
78
96
  "expected": 1
79
97
  },
80
98
  {
81
99
  "description": "non-unique character in second strand",
82
100
  "property": "distance",
83
- "strand1": "AAA",
84
- "strand2": "AAG",
101
+ "input": {
102
+ "strand1": "AAA",
103
+ "strand2": "AAG"
104
+ },
85
105
  "expected": 1
86
106
  },
87
107
  {
88
108
  "description": "same nucleotides in different positions",
89
109
  "property": "distance",
90
- "strand1": "TAG",
91
- "strand2": "GAT",
110
+ "input": {
111
+ "strand1": "TAG",
112
+ "strand2": "GAT"
113
+ },
92
114
  "expected": 2
93
115
  },
94
116
  {
95
117
  "description": "large distance",
96
118
  "property": "distance",
97
- "strand1": "GATACA",
98
- "strand2": "GCATAA",
119
+ "input": {
120
+ "strand1": "GATACA",
121
+ "strand2": "GCATAA"
122
+ },
99
123
  "expected": 4
100
124
  },
101
125
  {
102
126
  "description": "large distance in off-by-one strand",
103
127
  "property": "distance",
104
- "strand1": "GGACGGATTCTG",
105
- "strand2": "AGGACGGATTCT",
128
+ "input": {
129
+ "strand1": "GGACGGATTCTG",
130
+ "strand2": "AGGACGGATTCT"
131
+ },
106
132
  "expected": 9
107
133
  },
108
134
  {
109
135
  "description": "disallow first strand longer",
110
136
  "property": "distance",
111
- "strand1": "AATG",
112
- "strand2": "AAA",
137
+ "input": {
138
+ "strand1": "AATG",
139
+ "strand2": "AAA"
140
+ },
113
141
  "expected": {"error": "left and right strands must be of equal length"}
114
142
  },
115
143
  {
116
144
  "description": "disallow second strand longer",
117
145
  "property": "distance",
118
- "strand1": "ATA",
119
- "strand2": "AGTG",
146
+ "input": {
147
+ "strand1": "ATA",
148
+ "strand2": "AGTG"
149
+ },
120
150
  "expected": {"error": "left and right strands must be of equal length"}
121
151
  }
122
152
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "react",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "comments": [
5
5
  "Note that, due to the nature of this exercise,",
6
6
  "the tests are specified using their cells and a series of operations to perform on the cells.",
@@ -46,313 +46,340 @@
46
46
  {
47
47
  "description": "input cells have a value",
48
48
  "property": "react",
49
- "cells": [
50
- {
51
- "name": "input",
52
- "type": "input",
53
- "initial_value": 10
54
- }
55
- ],
56
- "operations": [
57
- {
58
- "type": "expect_cell_value",
59
- "cell": "input",
60
- "value": 10
61
- }
62
- ]
49
+ "input": {
50
+ "cells": [
51
+ {
52
+ "name": "input",
53
+ "type": "input",
54
+ "initial_value": 10
55
+ }
56
+ ],
57
+ "operations": [
58
+ {
59
+ "type": "expect_cell_value",
60
+ "cell": "input",
61
+ "value": 10
62
+ }
63
+ ]
64
+ },
65
+ "expected": {}
63
66
  },
64
67
  {
65
68
  "description": "an input cell's value can be set",
66
69
  "property": "react",
67
- "cells": [
68
- {
69
- "name": "input",
70
- "type": "input",
71
- "initial_value": 4
72
- }
73
- ],
74
- "operations": [
75
- {
76
- "type": "set_value",
77
- "cell": "input",
78
- "value": 20
79
- },
80
- {
81
- "type": "expect_cell_value",
82
- "cell": "input",
83
- "value": 20
84
- }
85
- ]
70
+ "input": {
71
+ "cells": [
72
+ {
73
+ "name": "input",
74
+ "type": "input",
75
+ "initial_value": 4
76
+ }
77
+ ],
78
+ "operations": [
79
+ {
80
+ "type": "set_value",
81
+ "cell": "input",
82
+ "value": 20
83
+ },
84
+ {
85
+ "type": "expect_cell_value",
86
+ "cell": "input",
87
+ "value": 20
88
+ }
89
+ ]
90
+ },
91
+ "expected": {}
86
92
  },
87
93
  {
88
94
  "description": "compute cells calculate initial value",
89
95
  "property": "react",
90
- "cells": [
91
- {
92
- "name": "input",
93
- "type": "input",
94
- "initial_value": 1
95
- },
96
- {
97
- "name": "output",
98
- "type": "compute",
99
- "inputs": ["input"],
100
- "compute_function": "inputs[0] + 1"
101
- }
102
- ],
103
- "operations": [
104
- {
105
- "type": "expect_cell_value",
106
- "cell": "output",
107
- "value": 2
108
- }
109
- ]
96
+ "input": {
97
+ "cells": [
98
+ {
99
+ "name": "input",
100
+ "type": "input",
101
+ "initial_value": 1
102
+ },
103
+ {
104
+ "name": "output",
105
+ "type": "compute",
106
+ "inputs": ["input"],
107
+ "compute_function": "inputs[0] + 1"
108
+ }
109
+ ],
110
+ "operations": [
111
+ {
112
+ "type": "expect_cell_value",
113
+ "cell": "output",
114
+ "value": 2
115
+ }
116
+ ]
117
+ },
118
+ "expected": {}
110
119
  },
111
120
  {
112
121
  "description": "compute cells take inputs in the right order",
113
122
  "property": "react",
114
- "cells": [
115
- {
116
- "name": "one",
117
- "type": "input",
118
- "initial_value": 1
119
- },
120
- {
121
- "name": "two",
122
- "type": "input",
123
- "initial_value": 2
124
- },
125
- {
126
- "name": "output",
127
- "type": "compute",
128
- "inputs": ["one", "two"],
129
- "compute_function": "inputs[0] + inputs[1] * 10"
130
- }
131
- ],
132
- "operations": [
133
- {
134
- "type": "expect_cell_value",
135
- "cell": "output",
136
- "value": 21
137
- }
138
- ]
123
+ "input": {
124
+ "cells": [
125
+ {
126
+ "name": "one",
127
+ "type": "input",
128
+ "initial_value": 1
129
+ },
130
+ {
131
+ "name": "two",
132
+ "type": "input",
133
+ "initial_value": 2
134
+ },
135
+ {
136
+ "name": "output",
137
+ "type": "compute",
138
+ "inputs": ["one", "two"],
139
+ "compute_function": "inputs[0] + inputs[1] * 10"
140
+ }
141
+ ],
142
+ "operations": [
143
+ {
144
+ "type": "expect_cell_value",
145
+ "cell": "output",
146
+ "value": 21
147
+ }
148
+ ]
149
+ },
150
+ "expected": {}
139
151
  },
140
152
  {
141
153
  "description": "compute cells update value when dependencies are changed",
142
154
  "property": "react",
143
- "cells": [
144
- {
145
- "name": "input",
146
- "type": "input",
147
- "initial_value": 1
148
- },
149
- {
150
- "name": "output",
151
- "type": "compute",
152
- "inputs": ["input"],
153
- "compute_function": "inputs[0] + 1"
154
- }
155
- ],
156
- "operations": [
157
- {
158
- "type": "set_value",
159
- "cell": "input",
160
- "value": 3
161
- },
162
- {
163
- "type": "expect_cell_value",
164
- "cell": "output",
165
- "value": 4
166
- }
167
- ]
155
+ "input": {
156
+ "cells": [
157
+ {
158
+ "name": "input",
159
+ "type": "input",
160
+ "initial_value": 1
161
+ },
162
+ {
163
+ "name": "output",
164
+ "type": "compute",
165
+ "inputs": ["input"],
166
+ "compute_function": "inputs[0] + 1"
167
+ }
168
+ ],
169
+ "operations": [
170
+ {
171
+ "type": "set_value",
172
+ "cell": "input",
173
+ "value": 3
174
+ },
175
+ {
176
+ "type": "expect_cell_value",
177
+ "cell": "output",
178
+ "value": 4
179
+ }
180
+ ]
181
+ },
182
+ "expected": {}
168
183
  },
169
184
  {
170
185
  "description": "compute cells can depend on other compute cells",
171
186
  "property": "react",
172
- "cells": [
173
- {
174
- "name": "input",
175
- "type": "input",
176
- "initial_value": 1
177
- },
178
- {
179
- "name": "times_two",
180
- "type": "compute",
181
- "inputs": ["input"],
182
- "compute_function": "inputs[0] * 2"
183
- },
184
- {
185
- "name": "times_thirty",
186
- "type": "compute",
187
- "inputs": ["input"],
188
- "compute_function": "inputs[0] * 30"
189
- },
190
- {
191
- "name": "output",
192
- "type": "compute",
193
- "inputs": ["times_two", "times_thirty"],
194
- "compute_function": "inputs[0] + inputs[1]"
195
- }
196
- ],
197
- "operations": [
198
- {
199
- "type": "expect_cell_value",
200
- "cell": "output",
201
- "value": 32
202
- },
203
- {
204
- "type": "set_value",
205
- "cell": "input",
206
- "value": 3
207
- },
208
- {
209
- "type": "expect_cell_value",
210
- "cell": "output",
211
- "value": 96
212
- }
213
- ]
187
+ "input": {
188
+ "cells": [
189
+ {
190
+ "name": "input",
191
+ "type": "input",
192
+ "initial_value": 1
193
+ },
194
+ {
195
+ "name": "times_two",
196
+ "type": "compute",
197
+ "inputs": ["input"],
198
+ "compute_function": "inputs[0] * 2"
199
+ },
200
+ {
201
+ "name": "times_thirty",
202
+ "type": "compute",
203
+ "inputs": ["input"],
204
+ "compute_function": "inputs[0] * 30"
205
+ },
206
+ {
207
+ "name": "output",
208
+ "type": "compute",
209
+ "inputs": ["times_two", "times_thirty"],
210
+ "compute_function": "inputs[0] + inputs[1]"
211
+ }
212
+ ],
213
+ "operations": [
214
+ {
215
+ "type": "expect_cell_value",
216
+ "cell": "output",
217
+ "value": 32
218
+ },
219
+ {
220
+ "type": "set_value",
221
+ "cell": "input",
222
+ "value": 3
223
+ },
224
+ {
225
+ "type": "expect_cell_value",
226
+ "cell": "output",
227
+ "value": 96
228
+ }
229
+ ]
230
+ },
231
+ "expected": {}
214
232
  },
215
233
  {
216
234
  "description": "compute cells fire callbacks",
217
235
  "property": "react",
218
- "cells": [
219
- {
220
- "name": "input",
221
- "type": "input",
222
- "initial_value": 1
223
- },
224
- {
225
- "name": "output",
226
- "type": "compute",
227
- "inputs": ["input"],
228
- "compute_function": "inputs[0] + 1"
229
- }
230
- ],
231
- "operations": [
232
- {
233
- "type": "add_callback",
234
- "cell": "output",
235
- "name": "callback1"
236
- },
237
- {
238
- "type": "set_value",
239
- "cell": "input",
240
- "value": 3
241
- },
242
- {
243
- "type": "expect_callback_values",
244
- "callback": "callback1",
245
- "values": [4]
246
- }
247
- ]
236
+ "input": {
237
+ "cells": [
238
+ {
239
+ "name": "input",
240
+ "type": "input",
241
+ "initial_value": 1
242
+ },
243
+ {
244
+ "name": "output",
245
+ "type": "compute",
246
+ "inputs": ["input"],
247
+ "compute_function": "inputs[0] + 1"
248
+ }
249
+ ],
250
+ "operations": [
251
+ {
252
+ "type": "add_callback",
253
+ "cell": "output",
254
+ "name": "callback1"
255
+ },
256
+ {
257
+ "type": "set_value",
258
+ "cell": "input",
259
+ "value": 3
260
+ },
261
+ {
262
+ "type": "expect_callback_values",
263
+ "callback": "callback1",
264
+ "values": [4]
265
+ }
266
+ ]
267
+ },
268
+ "expected": {}
248
269
  },
249
270
  {
250
271
  "description": "callback cells only fire on change",
251
272
  "property": "react",
252
- "cells": [
253
- {
254
- "name": "input",
255
- "type": "input",
256
- "initial_value": 1
257
- },
258
- {
259
- "name": "output",
260
- "type": "compute",
261
- "inputs": ["input"],
262
- "compute_function": "if inputs[0] < 3 then 111 else 222"
263
- }
264
- ],
265
- "operations": [
266
- {
267
- "type": "add_callback",
268
- "cell": "output",
269
- "name": "callback1"
270
- },
271
- {
272
- "type": "set_value",
273
- "cell": "input",
274
- "value": 2
275
- },
276
- {
277
- "type": "expect_callback_values",
278
- "callback": "callback1",
279
- "values": []
280
- },
281
- {
282
- "type": "set_value",
283
- "cell": "input",
284
- "value": 4
285
- },
286
- {
287
- "type": "expect_callback_values",
288
- "callback": "callback1",
289
- "values": [222]
290
- }
291
- ]
273
+ "input": {
274
+ "cells": [
275
+ {
276
+ "name": "input",
277
+ "type": "input",
278
+ "initial_value": 1
279
+ },
280
+ {
281
+ "name": "output",
282
+ "type": "compute",
283
+ "inputs": ["input"],
284
+ "compute_function": "if inputs[0] < 3 then 111 else 222"
285
+ }
286
+ ],
287
+ "operations": [
288
+ {
289
+ "type": "add_callback",
290
+ "cell": "output",
291
+ "name": "callback1"
292
+ },
293
+ {
294
+ "type": "set_value",
295
+ "cell": "input",
296
+ "value": 2
297
+ },
298
+ {
299
+ "type": "expect_callback_values",
300
+ "callback": "callback1",
301
+ "values": []
302
+ },
303
+ {
304
+ "type": "set_value",
305
+ "cell": "input",
306
+ "value": 4
307
+ },
308
+ {
309
+ "type": "expect_callback_values",
310
+ "callback": "callback1",
311
+ "values": [222]
312
+ }
313
+ ]
314
+ },
315
+ "expected": {}
292
316
  },
293
317
  {
294
318
  "description": "callbacks can be added and removed",
295
319
  "property": "react",
296
- "cells": [
297
- {
298
- "name": "input",
299
- "type": "input",
300
- "initial_value": 11
301
- },
302
- {
303
- "name": "output",
304
- "type": "compute",
305
- "inputs": ["input"],
306
- "compute_function": "inputs[0] + 1"
307
- }
308
- ],
309
- "operations": [
310
- {
311
- "type": "add_callback",
312
- "cell": "output",
313
- "name": "callback1"
314
- },
315
- {
316
- "type": "add_callback",
317
- "cell": "output",
318
- "name": "callback2"
319
- },
320
- {
321
- "type": "set_value",
322
- "cell": "input",
323
- "value": 31
324
- },
325
- {
326
- "type": "remove_callback",
327
- "cell": "output",
328
- "name": "callback1"
329
- },
330
- {
331
- "type": "add_callback",
332
- "cell": "output",
333
- "name": "callback3"
334
- },
335
- {
336
- "type": "set_value",
337
- "cell": "input",
338
- "value": 41
339
- },
340
- {
341
- "type": "expect_callback_values",
342
- "callback": "callback1",
343
- "values": [32]
344
- },
345
- {
346
- "type": "expect_callback_values",
347
- "callback": "callback2",
348
- "values": [32, 42]
349
- },
350
- {
351
- "type": "expect_callback_values",
352
- "callback": "callback3",
353
- "values": [42]
354
- }
355
- ]
320
+ "input": {
321
+ "cells": [
322
+ {
323
+ "name": "input",
324
+ "type": "input",
325
+ "initial_value": 11
326
+ },
327
+ {
328
+ "name": "output",
329
+ "type": "compute",
330
+ "inputs": ["input"],
331
+ "compute_function": "inputs[0] + 1"
332
+ }
333
+ ],
334
+ "operations": [
335
+ {
336
+ "type": "add_callback",
337
+ "cell": "output",
338
+ "name": "callback1"
339
+ },
340
+ {
341
+ "type": "add_callback",
342
+ "cell": "output",
343
+ "name": "callback2"
344
+ },
345
+ {
346
+ "type": "set_value",
347
+ "cell": "input",
348
+ "value": 31
349
+ },
350
+ {
351
+ "type": "remove_callback",
352
+ "cell": "output",
353
+ "name": "callback1"
354
+ },
355
+ {
356
+ "type": "add_callback",
357
+ "cell": "output",
358
+ "name": "callback3"
359
+ },
360
+ {
361
+ "type": "set_value",
362
+ "cell": "input",
363
+ "value": 41
364
+ },
365
+ {
366
+ "type": "expect_callback_values",
367
+ "callback": "callback1",
368
+ "values": [32]
369
+ },
370
+ {
371
+ "type": "expect_callback_values",
372
+ "callback": "callback2",
373
+ "values": [32, 42]
374
+ },
375
+ {
376
+ "type": "expect_callback_values",
377
+ "callback": "callback3",
378
+ "values": [42]
379
+ }
380
+ ]
381
+ },
382
+ "expected": {}
356
383
  },
357
384
  {
358
385
  "description": "removing a callback multiple times doesn't interfere with other callbacks",
@@ -362,61 +389,64 @@
362
389
  "or causes an out of bounds access."
363
390
  ],
364
391
  "property": "react",
365
- "cells": [
366
- {
367
- "name": "input",
368
- "type": "input",
369
- "initial_value": 1
370
- },
371
- {
372
- "name": "output",
373
- "type": "compute",
374
- "inputs": ["input"],
375
- "compute_function": "inputs[0] + 1"
376
- }
377
- ],
378
- "operations": [
379
- {
380
- "type": "add_callback",
381
- "cell": "output",
382
- "name": "callback1"
383
- },
384
- {
385
- "type": "add_callback",
386
- "cell": "output",
387
- "name": "callback2"
388
- },
389
- {
390
- "type": "remove_callback",
391
- "cell": "output",
392
- "name": "callback1"
393
- },
394
- {
395
- "type": "remove_callback",
396
- "cell": "output",
397
- "name": "callback1"
398
- },
399
- {
400
- "type": "remove_callback",
401
- "cell": "output",
402
- "name": "callback1"
403
- },
404
- {
405
- "type": "set_value",
406
- "cell": "input",
407
- "value": 2
408
- },
409
- {
410
- "type": "expect_callback_values",
411
- "callback": "callback1",
412
- "values": []
413
- },
414
- {
415
- "type": "expect_callback_values",
416
- "callback": "callback2",
417
- "values": [3]
418
- }
419
- ]
392
+ "input": {
393
+ "cells": [
394
+ {
395
+ "name": "input",
396
+ "type": "input",
397
+ "initial_value": 1
398
+ },
399
+ {
400
+ "name": "output",
401
+ "type": "compute",
402
+ "inputs": ["input"],
403
+ "compute_function": "inputs[0] + 1"
404
+ }
405
+ ],
406
+ "operations": [
407
+ {
408
+ "type": "add_callback",
409
+ "cell": "output",
410
+ "name": "callback1"
411
+ },
412
+ {
413
+ "type": "add_callback",
414
+ "cell": "output",
415
+ "name": "callback2"
416
+ },
417
+ {
418
+ "type": "remove_callback",
419
+ "cell": "output",
420
+ "name": "callback1"
421
+ },
422
+ {
423
+ "type": "remove_callback",
424
+ "cell": "output",
425
+ "name": "callback1"
426
+ },
427
+ {
428
+ "type": "remove_callback",
429
+ "cell": "output",
430
+ "name": "callback1"
431
+ },
432
+ {
433
+ "type": "set_value",
434
+ "cell": "input",
435
+ "value": 2
436
+ },
437
+ {
438
+ "type": "expect_callback_values",
439
+ "callback": "callback1",
440
+ "values": []
441
+ },
442
+ {
443
+ "type": "expect_callback_values",
444
+ "callback": "callback2",
445
+ "values": [3]
446
+ }
447
+ ]
448
+ },
449
+ "expected": {}
420
450
  },
421
451
  {
422
452
  "description": "callbacks should only be called once even if multiple dependencies change",
@@ -425,54 +455,57 @@
425
455
  "when not all of the inputs of a compute cell have propagated new values."
426
456
  ],
427
457
  "property": "react",
428
- "cells": [
429
- {
430
- "name": "input",
431
- "type": "input",
432
- "initial_value": 1
433
- },
434
- {
435
- "name": "plus_one",
436
- "type": "compute",
437
- "inputs": ["input"],
438
- "compute_function": "inputs[0] + 1"
439
- },
440
- {
441
- "name": "minus_one1",
442
- "type": "compute",
443
- "inputs": ["input"],
444
- "compute_function": "inputs[0] - 1"
445
- },
446
- {
447
- "name": "minus_one2",
448
- "type": "compute",
449
- "inputs": ["minus_one1"],
450
- "compute_function": "inputs[0] - 1"
451
- },
452
- {
453
- "name": "output",
454
- "type": "compute",
455
- "inputs": ["plus_one", "minus_one2"],
456
- "compute_function": "inputs[0] * inputs[1]"
457
- }
458
- ],
459
- "operations": [
460
- {
461
- "type": "add_callback",
462
- "cell": "output",
463
- "name": "callback1"
464
- },
465
- {
466
- "type": "set_value",
467
- "cell": "input",
468
- "value": 4
469
- },
470
- {
471
- "type": "expect_callback_values",
472
- "callback": "callback1",
473
- "values": [10]
474
- }
475
- ]
458
+ "input": {
459
+ "cells": [
460
+ {
461
+ "name": "input",
462
+ "type": "input",
463
+ "initial_value": 1
464
+ },
465
+ {
466
+ "name": "plus_one",
467
+ "type": "compute",
468
+ "inputs": ["input"],
469
+ "compute_function": "inputs[0] + 1"
470
+ },
471
+ {
472
+ "name": "minus_one1",
473
+ "type": "compute",
474
+ "inputs": ["input"],
475
+ "compute_function": "inputs[0] - 1"
476
+ },
477
+ {
478
+ "name": "minus_one2",
479
+ "type": "compute",
480
+ "inputs": ["minus_one1"],
481
+ "compute_function": "inputs[0] - 1"
482
+ },
483
+ {
484
+ "name": "output",
485
+ "type": "compute",
486
+ "inputs": ["plus_one", "minus_one2"],
487
+ "compute_function": "inputs[0] * inputs[1]"
488
+ }
489
+ ],
490
+ "operations": [
491
+ {
492
+ "type": "add_callback",
493
+ "cell": "output",
494
+ "name": "callback1"
495
+ },
496
+ {
497
+ "type": "set_value",
498
+ "cell": "input",
499
+ "value": 4
500
+ },
501
+ {
502
+ "type": "expect_callback_values",
503
+ "callback": "callback1",
504
+ "values": [10]
505
+ }
506
+ ]
507
+ },
508
+ "expected": {}
476
509
  },
477
510
  {
478
511
  "description": "callbacks should not be called if dependencies change but output value doesn't change",
@@ -482,63 +515,66 @@
482
515
  "This is incorrect since the specification indicates only to call callbacks on change."
483
516
  ],
484
517
  "property": "react",
485
- "cells": [
486
- {
487
- "name": "input",
488
- "type": "input",
489
- "initial_value": 1
490
- },
491
- {
492
- "name": "plus_one",
493
- "type": "compute",
494
- "inputs": ["input"],
495
- "compute_function": "inputs[0] + 1"
496
- },
497
- {
498
- "name": "minus_one",
499
- "type": "compute",
500
- "inputs": ["input"],
501
- "compute_function": "inputs[0] - 1"
502
- },
503
- {
504
- "name": "always_two",
505
- "type": "compute",
506
- "inputs": ["plus_one", "minus_one"],
507
- "compute_function": "inputs[0] - inputs[1]"
508
- }
509
- ],
510
- "operations": [
511
- {
512
- "type": "add_callback",
513
- "cell": "always_two",
514
- "name": "callback1"
515
- },
516
- {
517
- "type": "set_value",
518
- "cell": "input",
519
- "value": 2
520
- },
521
- {
522
- "type": "set_value",
523
- "cell": "input",
524
- "value": 3
525
- },
526
- {
527
- "type": "set_value",
528
- "cell": "input",
529
- "value": 4
530
- },
531
- {
532
- "type": "set_value",
533
- "cell": "input",
534
- "value": 5
535
- },
536
- {
537
- "type": "expect_callback_values",
538
- "callback": "callback1",
539
- "values": []
540
- }
541
- ]
518
+ "input": {
519
+ "cells": [
520
+ {
521
+ "name": "input",
522
+ "type": "input",
523
+ "initial_value": 1
524
+ },
525
+ {
526
+ "name": "plus_one",
527
+ "type": "compute",
528
+ "inputs": ["input"],
529
+ "compute_function": "inputs[0] + 1"
530
+ },
531
+ {
532
+ "name": "minus_one",
533
+ "type": "compute",
534
+ "inputs": ["input"],
535
+ "compute_function": "inputs[0] - 1"
536
+ },
537
+ {
538
+ "name": "always_two",
539
+ "type": "compute",
540
+ "inputs": ["plus_one", "minus_one"],
541
+ "compute_function": "inputs[0] - inputs[1]"
542
+ }
543
+ ],
544
+ "operations": [
545
+ {
546
+ "type": "add_callback",
547
+ "cell": "always_two",
548
+ "name": "callback1"
549
+ },
550
+ {
551
+ "type": "set_value",
552
+ "cell": "input",
553
+ "value": 2
554
+ },
555
+ {
556
+ "type": "set_value",
557
+ "cell": "input",
558
+ "value": 3
559
+ },
560
+ {
561
+ "type": "set_value",
562
+ "cell": "input",
563
+ "value": 4
564
+ },
565
+ {
566
+ "type": "set_value",
567
+ "cell": "input",
568
+ "value": 5
569
+ },
570
+ {
571
+ "type": "expect_callback_values",
572
+ "callback": "callback1",
573
+ "values": []
574
+ }
575
+ ]
576
+ },
577
+ "expected": {}
542
578
  }
543
579
  ]
544
580
  }