trackler 2.0.8.18 → 2.0.8.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/common/.gitignore +1 -0
  3. data/common/.travis.yml +5 -8
  4. data/common/README.md +18 -5
  5. data/common/exercises/grep/canonical-data.json +290 -269
  6. data/common/exercises/phone-number/canonical-data.json +2 -2
  7. data/common/exercises/pov/canonical-data.json +2 -5
  8. data/common/exercises/roman-numerals/canonical-data.json +112 -74
  9. data/common/exercises/tournament/canonical-data.json +86 -85
  10. data/common/exercises/two-bucket/canonical-data.json +55 -47
  11. data/common/package.json +16 -0
  12. data/common/yarn.lock +195 -0
  13. data/lib/trackler/version.rb +1 -1
  14. data/tracks/c/docs/LEARNING.md +1 -1
  15. data/tracks/c/exercises/space-age/src/example.c +15 -47
  16. data/tracks/c/exercises/space-age/src/example.h +12 -8
  17. data/tracks/c/exercises/space-age/test/test_space_age.c +8 -8
  18. data/tracks/ceylon/docs/TESTS.md +5 -2
  19. data/tracks/ceylon/exercises/TRACK_HINTS.md +5 -2
  20. data/tracks/csharp/.gitignore +0 -4
  21. data/tracks/csharp/.travis.yml +9 -20
  22. data/tracks/csharp/appveyor.yml +2 -4
  23. data/tracks/csharp/build.cake +95 -0
  24. data/tracks/csharp/build.ps1 +189 -0
  25. data/tracks/csharp/build.sh +99 -31
  26. data/tracks/csharp/circle.yml +3 -12
  27. data/tracks/delphi/config.json +8 -0
  28. data/tracks/delphi/exercises/minesweeper/MineSweeper.dpr +60 -0
  29. data/tracks/delphi/exercises/minesweeper/uMineSweeperExample.pas +70 -0
  30. data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +270 -0
  31. data/tracks/dlang/config.json +86 -31
  32. data/tracks/elixir/config.json +7 -0
  33. data/tracks/elixir/exercises/rotational-cipher/example.exs +35 -0
  34. data/tracks/elixir/exercises/rotational-cipher/rotational_cipher.exs +13 -0
  35. data/tracks/elixir/exercises/rotational-cipher/rotational_cipher_test.exs +80 -0
  36. data/tracks/go/exercises/raindrops/raindrops_test.go +4 -1
  37. data/tracks/go/exercises/react/react_test.go +6 -8
  38. data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +4 -1
  39. data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +5 -2
  40. data/tracks/haskell/exercises/allergies/src/Allergies.hs +2 -2
  41. data/tracks/haskell/exercises/atbash-cipher/src/Atbash.hs +2 -2
  42. data/tracks/haskell/exercises/bank-account/src/BankAccount.hs +3 -3
  43. data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +7 -7
  44. data/tracks/haskell/exercises/bowling/src/Bowling.hs +1 -1
  45. data/tracks/haskell/exercises/clock/src/Clock.hs +4 -4
  46. data/tracks/haskell/exercises/connect/src/Connect.hs +1 -1
  47. data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +1 -1
  48. data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +12 -12
  49. data/tracks/haskell/exercises/difference-of-squares/src/Squares.hs +3 -3
  50. data/tracks/haskell/exercises/etl/src/ETL.hs +1 -1
  51. data/tracks/haskell/exercises/forth/src/Forth.hs +2 -2
  52. data/tracks/haskell/exercises/go-counting/src/Counting.hs +2 -2
  53. data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -3
  54. data/tracks/haskell/exercises/largest-series-product/src/Series.hs +1 -1
  55. data/tracks/haskell/exercises/lens-person/src/Person.hs +4 -4
  56. data/tracks/julia/.travis.yml +3 -2
  57. data/tracks/ocaml/exercises/all-your-base/test.ml +2 -2
  58. data/tracks/ocaml/exercises/beer-song/test.ml +25 -24
  59. data/tracks/ocaml/exercises/phone-number/test.ml +22 -22
  60. data/tracks/ocaml/exercises/run-length-encoding/test.ml +5 -5
  61. data/tracks/ocaml/exercises/word-count/test.ml +1 -1
  62. data/tracks/ocaml/tools/test-generator/templates/beer-song/template.ml +20 -1
  63. data/tracks/purescript/config.json +7 -0
  64. data/tracks/purescript/exercises/word-count/bower.json +17 -0
  65. data/tracks/purescript/exercises/word-count/examples/src/WordCount.purs +31 -0
  66. data/tracks/purescript/exercises/word-count/src/WordCount.purs +3 -0
  67. data/tracks/purescript/exercises/word-count/test/Main.purs +89 -0
  68. data/tracks/python/exercises/accumulate/accumulate.py +2 -0
  69. data/tracks/python/exercises/acronym/acronym.py +2 -0
  70. data/tracks/python/exercises/allergies/allergies.py +3 -0
  71. data/tracks/python/exercises/allergies/example.py +1 -1
  72. data/tracks/python/exercises/anagram/anagram.py +2 -0
  73. data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +6 -0
  74. data/tracks/python/exercises/beer-song/beer_song.py +6 -0
  75. data/tracks/python/exercises/binary-search/binary_search.py +2 -0
  76. data/tracks/python/exercises/binary/binary.py +2 -0
  77. data/tracks/python/exercises/bob/bob.py +2 -8
  78. data/tracks/python/exercises/bracket-push/bracket_push.py +2 -0
  79. data/tracks/python/exercises/circular-buffer/circular_buffer.py +11 -0
  80. data/tracks/python/exercises/clock/clock.py +3 -0
  81. data/tracks/python/exercises/clock/example.py +1 -1
  82. data/tracks/python/exercises/crypto-square/crypto_square.py +2 -0
  83. data/tracks/python/exercises/diamond/diamond.py +2 -0
  84. data/tracks/python/exercises/difference-of-squares/difference_of_squares.py +10 -0
  85. data/tracks/python/exercises/etl/etl.py +2 -0
  86. data/tracks/python/exercises/flatten-array/flatten_array.py +2 -0
  87. data/tracks/python/exercises/gigasecond/gigasecond.py +2 -0
  88. data/tracks/python/exercises/grade-school/grade_school.py +3 -0
  89. data/tracks/python/exercises/grains/grains.py +6 -0
  90. data/tracks/python/exercises/hamming/hamming.py +2 -0
  91. data/tracks/python/exercises/hello-world/hello_world.py +2 -7
  92. data/tracks/python/exercises/hexadecimal/hexadecimal.py +2 -0
  93. data/tracks/python/exercises/house/house.py +6 -0
  94. data/tracks/python/exercises/kindergarten-garden/kindergarten_garden.py +3 -0
  95. data/tracks/python/exercises/largest-series-product/largest_series_product.py +2 -0
  96. data/tracks/python/exercises/leap/leap.py +2 -0
  97. data/tracks/python/exercises/linked-list/linked_list.py +2 -8
  98. data/tracks/python/exercises/list-ops/list_ops.py +18 -22
  99. data/tracks/python/exercises/luhn/luhn.py +3 -0
  100. data/tracks/python/exercises/matrix/matrix.py +3 -0
  101. data/tracks/python/exercises/meetup/meetup.py +2 -0
  102. data/tracks/python/exercises/minesweeper/minesweeper.py +2 -0
  103. data/tracks/python/exercises/nth-prime/nth_prime.py +2 -0
  104. data/tracks/python/exercises/nucleotide-count/nucleotide_count.py +6 -0
  105. data/tracks/python/exercises/ocr-numbers/ocr_numbers.py +6 -0
  106. data/tracks/python/exercises/ocr-numbers/{ocr_test.py → ocr_numbers_test.py} +0 -0
  107. data/tracks/python/exercises/octal/octal.py +2 -0
  108. data/tracks/python/exercises/palindrome-products/palindrome_products.py +6 -0
  109. data/tracks/python/exercises/pangram/pangram.py +2 -0
  110. data/tracks/python/exercises/pascals-triangle/pascals_triangle.py +10 -0
  111. data/tracks/python/exercises/perfect-numbers/perfect_numbers.py +6 -0
  112. data/tracks/python/exercises/phone-number/phone_number.py +3 -0
  113. data/tracks/python/exercises/pig-latin/pig_latin.py +2 -0
  114. data/tracks/python/exercises/point-mutations/point_mutations.py +2 -0
  115. data/tracks/python/exercises/poker/poker.py +2 -0
  116. data/tracks/python/exercises/prime-factors/prime_factors.py +2 -0
  117. data/tracks/python/exercises/proverb/proverb.py +2 -0
  118. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet.py +10 -0
  119. data/tracks/python/exercises/queen-attack/queen_attack.py +6 -0
  120. data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher.py +10 -0
  121. data/tracks/python/exercises/raindrops/raindrops.py +2 -0
  122. data/tracks/python/exercises/rectangles/example.py +1 -1
  123. data/tracks/python/exercises/rectangles/rectangles.py +2 -0
  124. data/tracks/python/exercises/rectangles/{rectangles_count_test.py → rectangles_test.py} +0 -0
  125. data/tracks/python/exercises/rna-transcription/rna_transcription.py +2 -0
  126. data/tracks/python/exercises/robot-name/robot_name.py +3 -0
  127. data/tracks/python/exercises/robot-simulator/robot_simulator.py +3 -0
  128. data/tracks/python/exercises/roman-numerals/roman_numerals.py +2 -0
  129. data/tracks/python/exercises/run-length-encoding/run_length_encoding.py +6 -0
  130. data/tracks/python/exercises/run-length-encoding/{run_length_test.py → run_length_encoding_test.py} +1 -1
  131. data/tracks/python/exercises/saddle-points/saddle_points.py +2 -0
  132. data/tracks/python/exercises/say/example.py +1 -1
  133. data/tracks/python/exercises/say/say.py +2 -0
  134. data/tracks/python/exercises/say/say_test.py +3 -0
  135. data/tracks/python/exercises/scrabble-score/scrabble_score.py +2 -0
  136. data/tracks/python/exercises/secret-handshake/secret_handshake.py +6 -0
  137. data/tracks/python/exercises/secret-handshake/{handshake_test.py → secret_handshake_test.py} +0 -0
  138. data/tracks/python/exercises/series/series.py +2 -0
  139. data/tracks/python/exercises/sieve/sieve.py +2 -0
  140. data/tracks/python/exercises/simple-cipher/example.py +1 -1
  141. data/tracks/python/exercises/simple-cipher/simple_cipher.py +8 -0
  142. data/tracks/python/exercises/space-age/space_age.py +3 -0
  143. data/tracks/python/exercises/strain/strain.py +6 -0
  144. data/tracks/python/exercises/sublist/sublist.py +2 -0
  145. data/tracks/python/exercises/sum-of-multiples/sum_of_multiples.py +2 -0
  146. data/tracks/python/exercises/triangle/triangle.py +7 -0
  147. data/tracks/python/exercises/trinary/trinary.py +2 -0
  148. data/tracks/python/exercises/twelve-days/twelve_days.py +10 -0
  149. data/tracks/python/exercises/word-count/word_count.py +2 -0
  150. data/tracks/python/exercises/wordy/wordy.py +2 -0
  151. data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +2 -0
  152. data/tracks/ruby/exercises/beer-song/.meta/.version +1 -0
  153. data/tracks/ruby/exercises/beer-song/beer_song_test.rb +62 -36
  154. data/tracks/ruby/exercises/beer-song/example.rb +1 -5
  155. data/tracks/ruby/exercises/beer-song/example.tt +22 -0
  156. data/tracks/ruby/lib/beer_song_cases.rb +43 -0
  157. data/tracks/swift/exercises/matrix/Tests/MatrixTests/MatrixTests.swift +1 -1
  158. metadata +94 -13
  159. data/common/bin/jsonlint +0 -27
  160. data/tracks/csharp/.paket/paket.bootstrapper.exe +0 -0
  161. data/tracks/csharp/Zipper.cs +0 -137
  162. data/tracks/csharp/build.cmd +0 -14
  163. data/tracks/csharp/build.fsx +0 -78
  164. data/tracks/csharp/paket.dependencies +0 -2
  165. data/tracks/csharp/paket.lock +0 -3
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "x-common",
3
+ "version": "1.0.0",
4
+ "description": "Shared metadata for exercism exercises.",
5
+ "main": "index.js",
6
+ "repository": "git@github.com:exercism/x-common.git",
7
+ "author": "Tejas Bubane <tejasbubane@gmail.com>",
8
+ "license": "MIT",
9
+ "dependencies": {
10
+ "ajv-cli": "^1.1.1"
11
+ },
12
+ "scripts": {
13
+ "test": "ajv -s canonical-schema.json -d \"exercises/*/canonical-data.json\"",
14
+ "test-one": "ajv -s canonical-schema.json -d"
15
+ }
16
+ }
data/common/yarn.lock ADDED
@@ -0,0 +1,195 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ abbrev@1:
6
+ version "1.1.0"
7
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f"
8
+
9
+ ajv-cli@^1.1.1:
10
+ version "1.1.1"
11
+ resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-1.1.1.tgz#08ba8006413e888973cfac650c3a95acc2e7c6be"
12
+ dependencies:
13
+ ajv "^4.7.4"
14
+ ajv-pack "^0.2.3"
15
+ fast-json-patch "^0.5.6"
16
+ glob "^7.0.3"
17
+ minimist "^1.2.0"
18
+
19
+ ajv-pack@^0.2.3:
20
+ version "0.2.7"
21
+ resolved "https://registry.yarnpkg.com/ajv-pack/-/ajv-pack-0.2.7.tgz#bdd340f1c6799108d7aac12975a000c6e2a362c8"
22
+ dependencies:
23
+ js-beautify "^1.6.4"
24
+ require-from-string "^1.2.0"
25
+
26
+ ajv@^4.7.4:
27
+ version "4.11.4"
28
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.4.tgz#ebf3a55d4b132ea60ff5847ae85d2ef069960b45"
29
+ dependencies:
30
+ co "^4.6.0"
31
+ json-stable-stringify "^1.0.1"
32
+
33
+ balanced-match@^0.4.1:
34
+ version "0.4.2"
35
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
36
+
37
+ bluebird@^3.0.5:
38
+ version "3.5.0"
39
+ resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c"
40
+
41
+ brace-expansion@^1.0.0:
42
+ version "1.1.6"
43
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
44
+ dependencies:
45
+ balanced-match "^0.4.1"
46
+ concat-map "0.0.1"
47
+
48
+ co@^4.6.0:
49
+ version "4.6.0"
50
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
51
+
52
+ commander@^2.9.0:
53
+ version "2.9.0"
54
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
55
+ dependencies:
56
+ graceful-readlink ">= 1.0.0"
57
+
58
+ concat-map@0.0.1:
59
+ version "0.0.1"
60
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
61
+
62
+ config-chain@~1.1.5:
63
+ version "1.1.11"
64
+ resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.11.tgz#aba09747dfbe4c3e70e766a6e41586e1859fc6f2"
65
+ dependencies:
66
+ ini "^1.3.4"
67
+ proto-list "~1.2.1"
68
+
69
+ editorconfig@^0.13.2:
70
+ version "0.13.2"
71
+ resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.13.2.tgz#8e57926d9ee69ab6cb999f027c2171467acceb35"
72
+ dependencies:
73
+ bluebird "^3.0.5"
74
+ commander "^2.9.0"
75
+ lru-cache "^3.2.0"
76
+ sigmund "^1.0.1"
77
+
78
+ fast-json-patch@^0.5.6:
79
+ version "0.5.7"
80
+ resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-0.5.7.tgz#b5a8f49d259624596ef98b872f3fda895b4d8665"
81
+
82
+ fs.realpath@^1.0.0:
83
+ version "1.0.0"
84
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
85
+
86
+ glob@^7.0.3:
87
+ version "7.1.1"
88
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
89
+ dependencies:
90
+ fs.realpath "^1.0.0"
91
+ inflight "^1.0.4"
92
+ inherits "2"
93
+ minimatch "^3.0.2"
94
+ once "^1.3.0"
95
+ path-is-absolute "^1.0.0"
96
+
97
+ "graceful-readlink@>= 1.0.0":
98
+ version "1.0.1"
99
+ resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
100
+
101
+ inflight@^1.0.4:
102
+ version "1.0.6"
103
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
104
+ dependencies:
105
+ once "^1.3.0"
106
+ wrappy "1"
107
+
108
+ inherits@2:
109
+ version "2.0.3"
110
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
111
+
112
+ ini@^1.3.4:
113
+ version "1.3.4"
114
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
115
+
116
+ js-beautify@^1.6.4:
117
+ version "1.6.11"
118
+ resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.6.11.tgz#538a22867e669250935bcdc7b90a8cd6386ddab6"
119
+ dependencies:
120
+ config-chain "~1.1.5"
121
+ editorconfig "^0.13.2"
122
+ mkdirp "~0.5.0"
123
+ nopt "~3.0.1"
124
+
125
+ json-stable-stringify@^1.0.1:
126
+ version "1.0.1"
127
+ resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
128
+ dependencies:
129
+ jsonify "~0.0.0"
130
+
131
+ jsonify@~0.0.0:
132
+ version "0.0.0"
133
+ resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
134
+
135
+ lru-cache@^3.2.0:
136
+ version "3.2.0"
137
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee"
138
+ dependencies:
139
+ pseudomap "^1.0.1"
140
+
141
+ minimatch@^3.0.2:
142
+ version "3.0.3"
143
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
144
+ dependencies:
145
+ brace-expansion "^1.0.0"
146
+
147
+ minimist@0.0.8:
148
+ version "0.0.8"
149
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
150
+
151
+ minimist@^1.2.0:
152
+ version "1.2.0"
153
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
154
+
155
+ mkdirp@~0.5.0:
156
+ version "0.5.1"
157
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
158
+ dependencies:
159
+ minimist "0.0.8"
160
+
161
+ nopt@~3.0.1:
162
+ version "3.0.6"
163
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
164
+ dependencies:
165
+ abbrev "1"
166
+
167
+ once@^1.3.0:
168
+ version "1.4.0"
169
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
170
+ dependencies:
171
+ wrappy "1"
172
+
173
+ path-is-absolute@^1.0.0:
174
+ version "1.0.1"
175
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
176
+
177
+ proto-list@~1.2.1:
178
+ version "1.2.4"
179
+ resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
180
+
181
+ pseudomap@^1.0.1:
182
+ version "1.0.2"
183
+ resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
184
+
185
+ require-from-string@^1.2.0:
186
+ version "1.2.1"
187
+ resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418"
188
+
189
+ sigmund@^1.0.1:
190
+ version "1.0.1"
191
+ resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
192
+
193
+ wrappy@1:
194
+ version "1.0.2"
195
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.0.8.18"
2
+ VERSION = "2.0.8.19"
3
3
  end
@@ -28,7 +28,7 @@ written for you. You progress through the exercise one test at a time,
28
28
  writing an implementation incrementally to satisfy the tests.
29
29
 
30
30
  If you are new to test-driven development, it is strongly recommended
31
- that you first work through a [quick overview of some test frameworks for C](http://www.drdobbs.com/testing/unit-testing-in-c-tools-and-conventions/240156344?pgno=2)
31
+ that you first work through a [quick overview of some test frameworks for C](http://www.drdobbs.com/testing/unit-testing-in-c-tools-and-conventions/240156344)
32
32
  or read the book [Test-Driven Development for Embedded C](https://pragprog.com/book/jgade/test-driven-development-for-embedded-c)
33
33
  by James Grenning. These resources cover [Unity](http://www.throwtheswitch.org/unity/)
34
34
  and [CppUTest](http://cpputest.github.io/); this track uses Unity.
@@ -1,53 +1,21 @@
1
1
  #include "space_age.h"
2
2
 
3
3
  /* Number of seconds in a Earth year */
4
- #define SECONDS_ON_EARTH_YEAR 31557600
4
+ #define EARTH 31557600
5
5
 
6
6
  /* Orbital period of each planet, in Earth years */
7
- #define MERCURY_YEAR (0.2408467 * SECONDS_ON_EARTH_YEAR)
8
- #define VENUS_YEAR (0.61519726 * SECONDS_ON_EARTH_YEAR)
9
- #define MARS_YEAR (1.8808158 * SECONDS_ON_EARTH_YEAR)
10
- #define JUPITER_YEAR (11.862615 * SECONDS_ON_EARTH_YEAR)
11
- #define SATURN_YEAR (29.447498 * SECONDS_ON_EARTH_YEAR)
12
- #define URANUS_YEAR (84.016846 * SECONDS_ON_EARTH_YEAR)
13
- #define NEPTUNE_YEAR (164.79132 * SECONDS_ON_EARTH_YEAR)
14
-
15
- float convert_earth_age(const long input)
16
- {
17
- return input / SECONDS_ON_EARTH_YEAR;
18
- }
19
-
20
- float convert_mercury_age(const long input)
21
- {
22
- return input / MERCURY_YEAR;
23
- }
24
-
25
- float convert_venus_age(const long input)
26
- {
27
- return input / VENUS_YEAR;
28
- }
29
-
30
- float convert_mars_age(const long input)
31
- {
32
- return input / MARS_YEAR;
33
- }
34
-
35
- float convert_jupiter_age(const long input)
36
- {
37
- return input / JUPITER_YEAR;
38
- }
39
-
40
- float convert_saturn_age(const long input)
41
- {
42
- return input / SATURN_YEAR;
43
- }
44
-
45
- float convert_uranus_age(const long input)
46
- {
47
- return input / URANUS_YEAR;
48
- }
49
-
50
- float convert_neptune_age(const long input)
51
- {
52
- return input / NEPTUNE_YEAR;
7
+ static const float factors[8] = {
8
+ EARTH * 0.2408467, // Mercury
9
+ EARTH * 0.61519726, // Venus
10
+ EARTH * 1, // Earth
11
+ EARTH * 1.8808158, // Mars
12
+ EARTH * 11.862615, // Jupiter
13
+ EARTH * 29.447498, // Saturn
14
+ EARTH * 84.016846, // Uranus
15
+ EARTH * 164.79132 // Neptune
16
+ };
17
+
18
+ float convert_planet_age(Planets planet, const long input)
19
+ {
20
+ return input / factors[planet];
53
21
  }
@@ -1,13 +1,17 @@
1
1
  #ifndef SPACE_AGE_H
2
2
  #define SPACE_AGE_H
3
3
 
4
- float convert_mercury_age(const long input);
5
- float convert_venus_age(const long input);
6
- float convert_earth_age(const long input);
7
- float convert_mars_age(const long input);
8
- float convert_jupiter_age(const long input);
9
- float convert_saturn_age(const long input);
10
- float convert_uranus_age(const long input);
11
- float convert_neptune_age(const long input);
4
+ typedef enum planets {
5
+ mercury,
6
+ venus,
7
+ earth,
8
+ mars,
9
+ jupiter,
10
+ saturn,
11
+ uranus,
12
+ neptune,
13
+ } Planets;
14
+
15
+ float convert_planet_age(Planets planet, const long input);
12
16
 
13
17
  #endif
@@ -3,42 +3,42 @@
3
3
 
4
4
  void test_convert_earth_year(void)
5
5
  {
6
- TEST_ASSERT_FLOAT_WITHIN(1, 31.69, convert_earth_age(1000000000));
6
+ TEST_ASSERT_FLOAT_WITHIN(1, 31.69, convert_planet_age(earth, 1000000000));
7
7
  }
8
8
 
9
9
  void test_convert_mercury_year(void)
10
10
  {
11
- TEST_ASSERT_FLOAT_WITHIN(3, 280.88, convert_mercury_age(2134835688));
11
+ TEST_ASSERT_FLOAT_WITHIN(3, 280.88, convert_planet_age(mercury, 2134835688));
12
12
  }
13
13
 
14
14
  void test_convert_venus_year(void)
15
15
  {
16
- TEST_ASSERT_FLOAT_WITHIN(1, 9.78, convert_venus_age(189839836));
16
+ TEST_ASSERT_FLOAT_WITHIN(1, 9.78, convert_planet_age(venus, 189839836));
17
17
  }
18
18
 
19
19
  void test_convert_mars_year(void)
20
20
  {
21
- TEST_ASSERT_FLOAT_WITHIN(1, 39.25, convert_mars_age(2329871239));
21
+ TEST_ASSERT_FLOAT_WITHIN(1, 39.25, convert_planet_age(mars, 2329871239));
22
22
  }
23
23
 
24
24
  void test_convert_jupiter_year(void)
25
25
  {
26
- TEST_ASSERT_FLOAT_WITHIN(0.1, 2.41, convert_jupiter_age(901876382));
26
+ TEST_ASSERT_FLOAT_WITHIN(0.1, 2.41, convert_planet_age(jupiter, 901876382));
27
27
  }
28
28
 
29
29
  void test_convert_saturn_year(void)
30
30
  {
31
- TEST_ASSERT_FLOAT_WITHIN(0.1, 3.23, convert_saturn_age(3000000000));
31
+ TEST_ASSERT_FLOAT_WITHIN(0.1, 3.23, convert_planet_age(saturn, 3000000000));
32
32
  }
33
33
 
34
34
  void test_convert_uranus_year(void)
35
35
  {
36
- TEST_ASSERT_FLOAT_WITHIN(0.1, 1.21, convert_uranus_age(3210123456));
36
+ TEST_ASSERT_FLOAT_WITHIN(0.1, 1.21, convert_planet_age(uranus, 3210123456));
37
37
  }
38
38
 
39
39
  void test_convert_neptune_year(void)
40
40
  {
41
- TEST_ASSERT_FLOAT_WITHIN(0.1, 1.58, convert_neptune_age(8210123456));
41
+ TEST_ASSERT_FLOAT_WITHIN(0.1, 1.58, convert_planet_age(neptune, 8210123456));
42
42
  }
43
43
 
44
44
  int main(void)
@@ -1,11 +1,14 @@
1
1
  ## Running Ceylon Tests
2
2
 
3
- We run tests with the [ceylon test](https://ceylon-lang.org/documentation/reference/tool/ceylon/subcommands/ceylon-test.html) command.
3
+ Before tests can be run, your code must be compiled via [`ceylon compile`](https://ceylon-lang.org/documentation/current/reference/tool/ceylon/subcommands/ceylon-compile.html).
4
+
5
+ We run tests with the [`ceylon test`](https://ceylon-lang.org/documentation/reference/tool/ceylon/subcommands/ceylon-test.html) command.
4
6
 
5
7
  `ceylon test` expects a module name to run the tests on.
6
8
  In the Ceylon track, each exercise has just a single module.
9
+
7
10
  Therefore, you can run the tests with:
8
11
 
9
12
  ```bash
10
- ceylon test $(basename source/*)
13
+ ceylon compile && ceylon test $(basename source/*)
11
14
  ```
@@ -1,11 +1,14 @@
1
1
  ## Running Ceylon Tests
2
2
 
3
- We run tests with the [ceylon test](https://ceylon-lang.org/documentation/reference/tool/ceylon/subcommands/ceylon-test.html) command.
3
+ Before tests can be run, your code must be compiled via [`ceylon compile`](https://ceylon-lang.org/documentation/current/reference/tool/ceylon/subcommands/ceylon-compile.html).
4
+
5
+ We run tests with the [`ceylon test`](https://ceylon-lang.org/documentation/reference/tool/ceylon/subcommands/ceylon-test.html) command.
4
6
 
5
7
  `ceylon test` expects a module name to run the tests on.
6
8
  In the Ceylon track, each exercise has just a single module.
9
+
7
10
  Therefore, you can run the tests with:
8
11
 
9
12
  ```bash
10
- ceylon test $(basename source/*)
13
+ ceylon compile && ceylon test $(basename source/*)
11
14
  ```
@@ -3,16 +3,12 @@
3
3
  tmp
4
4
  bin/configlet
5
5
  bin/configlet.exe
6
- .fake/
7
- .paket/paket.exe
8
6
  .vs/
9
7
  .vscode/
10
8
  tools/
11
9
  build/
12
10
  packages/
13
- paket-files
14
11
  TestResult.xml
15
- junit-results.xml
16
12
  obj/
17
13
  bin/
18
14
  *.userprefs
@@ -3,31 +3,20 @@ sudo: required
3
3
  dist: trusty
4
4
  addons:
5
5
  apt:
6
- sources: ['ubuntu-toolchain-r-test']
6
+ sources:
7
+ - sourceline: 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main'
8
+ key_url: 'https://apt-mo.trafficmanager.net/keys/microsoft.asc'
7
9
  packages:
8
- - gettext
9
- - libcurl4-openssl-dev
10
- - libicu-dev
11
- - libssl-dev
12
- - libunwind8
13
- - zlib1g
14
- - libstdc++6
15
- env:
16
- global:
17
- - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
18
- - DOTNET_CLI_TELEMETRY_OPTOUT: 1
10
+ - dotnet-dev-1.0.1
19
11
  mono:
20
12
  - 4.0.5
21
13
  os:
22
14
  - linux
23
-
24
- before_install:
25
- - curl https://download.microsoft.com/download/B/4/6/B4678511-01F4-4F97-902B-0E58A985932A/dotnet-dev-debian-x64.1.0.0-rc4-004771.tar.gz -o /tmp/dotnet.tar.gz
26
- - sudo mkdir -p /opt/dotnet
27
- - sudo tar zxf /tmp/dotnet.tar.gz -C /opt/dotnet
28
- - sudo ln -s /opt/dotnet/dotnet /usr/local/bin
29
-
15
+ env:
16
+ global:
17
+ - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
18
+ - DOTNET_CLI_TELEMETRY_OPTOUT: 1
30
19
  script:
31
20
  - ./bin/fetch-configlet
32
21
  - ./bin/configlet .
33
- - ./build.sh
22
+ - ./build.sh