trackler 2.0.8.24 → 2.0.8.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/c/config.json +9 -0
  4. data/tracks/c/exercises/nucleotide-count/makefile +15 -0
  5. data/tracks/c/exercises/nucleotide-count/src/example.c +43 -0
  6. data/tracks/c/exercises/nucleotide-count/src/example.h +6 -0
  7. data/tracks/c/exercises/nucleotide-count/test/test_nucleotide_count.c +58 -0
  8. data/tracks/c/exercises/nucleotide-count/test/vendor/unity.c +1300 -0
  9. data/tracks/c/exercises/nucleotide-count/test/vendor/unity.h +274 -0
  10. data/tracks/c/exercises/nucleotide-count/test/vendor/unity_internals.h +701 -0
  11. data/tracks/ceylon/README.md +2 -2
  12. data/tracks/csharp/.gitattributes +11 -0
  13. data/tracks/csharp/appveyor.yml +1 -4
  14. data/tracks/csharp/exercises/acronym/AcronymTest.cs +1 -1
  15. data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.cs +8 -3
  16. data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +76 -0
  17. data/tracks/csharp/exercises/atbash-cipher/Example.cs +22 -23
  18. data/tracks/csharp/exercises/isogram/Example.cs +2 -2
  19. data/tracks/csharp/exercises/isogram/IsogramTest.cs +47 -15
  20. data/tracks/csharp/exercises/nth-prime/Example.cs +4 -1
  21. data/tracks/csharp/exercises/nth-prime/NthPrime.cs +1 -1
  22. data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +29 -15
  23. data/tracks/csharp/exercises/perfect-numbers/Example.cs +14 -16
  24. data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.cs +2 -2
  25. data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +78 -26
  26. data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +69 -24
  27. data/tracks/csharp/exercises/raindrops/Example.cs +1 -1
  28. data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +93 -31
  29. data/tracks/csharp/exercises/roman-numerals/HINTS.md +2 -0
  30. data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +106 -23
  31. data/tracks/csharp/exercises/word-search/HINTS.md +6 -0
  32. data/tracks/csharp/generators/{TestClass.cs → Classes/TestClass.cs} +2 -1
  33. data/tracks/csharp/generators/{TestClassNameTransformer.cs → Classes/TestClassNameTransformer.cs} +1 -1
  34. data/tracks/csharp/generators/{TestClassRenderer.cs → Classes/TestClassRenderer.cs} +2 -1
  35. data/tracks/csharp/generators/Classes/TestedClassNameTransformer.cs +9 -0
  36. data/tracks/csharp/generators/{CanonicalData.cs → Data/CanonicalData.cs} +1 -1
  37. data/tracks/csharp/generators/{CanonicalDataCase.cs → Data/CanonicalDataCase.cs} +3 -3
  38. data/tracks/csharp/generators/{CanonicalDataCaseJsonConverter.cs → Data/CanonicalDataCaseJsonConverter.cs} +1 -1
  39. data/tracks/csharp/generators/{CanonicalDataCasesJsonConverter.cs → Data/CanonicalDataCasesJsonConverter.cs} +2 -2
  40. data/tracks/csharp/generators/{CanonicalDataParser.cs → Data/CanonicalDataParser.cs} +5 -5
  41. data/tracks/csharp/generators/{ExerciseCollection.cs → Data/ExerciseCollection.cs} +3 -3
  42. data/tracks/csharp/generators/Exercises/AcronymExercise.cs +20 -0
  43. data/tracks/csharp/generators/Exercises/AtbashCipherExercise.cs +20 -0
  44. data/tracks/csharp/generators/Exercises/BooleanExercise.cs +14 -0
  45. data/tracks/csharp/generators/Exercises/EqualityExercise.cs +14 -0
  46. data/tracks/csharp/generators/Exercises/Exercise.cs +59 -4
  47. data/tracks/csharp/generators/Exercises/IsogramExercise.cs +9 -0
  48. data/tracks/csharp/generators/Exercises/LeapExercise.cs +1 -4
  49. data/tracks/csharp/generators/Exercises/NthPrimeExercise.cs +25 -0
  50. data/tracks/csharp/generators/Exercises/PerfectNumbersExercise.cs +29 -0
  51. data/tracks/csharp/generators/Exercises/PigLatinExercise.cs +9 -0
  52. data/tracks/csharp/generators/Exercises/RaindropsExercise.cs +20 -0
  53. data/tracks/csharp/generators/Exercises/RomanNumeralsExercise.cs +30 -0
  54. data/tracks/csharp/generators/Helpers/StringExtensions.cs +8 -0
  55. data/tracks/csharp/generators/{To.cs → Helpers/To.cs} +4 -1
  56. data/tracks/csharp/generators/Methods/BooleanTestMethodGenerator.cs +32 -0
  57. data/tracks/csharp/generators/Methods/EqualityTestMethodGenerator.cs +25 -0
  58. data/tracks/csharp/generators/Methods/ExceptionTestMethodGenerator.cs +30 -0
  59. data/tracks/csharp/generators/{TestMethod.cs → Methods/TestMethod.cs} +6 -3
  60. data/tracks/csharp/generators/Methods/TestMethodData.cs +12 -0
  61. data/tracks/csharp/generators/Methods/TestMethodGenerator.cs +64 -0
  62. data/tracks/csharp/generators/Methods/TestMethodNameTransformer.cs +23 -0
  63. data/tracks/csharp/generators/Methods/TestMethodOptions.cs +13 -0
  64. data/tracks/csharp/generators/{TestMethodRenderer.cs → Methods/TestMethodRenderer.cs} +1 -1
  65. data/tracks/csharp/generators/{TestedMethodNameTransformer.cs → Methods/TestedMethodNameTransformer.cs} +1 -1
  66. data/tracks/csharp/generators/Methods/TestedMethodType.cs +9 -0
  67. data/tracks/csharp/generators/Program.cs +2 -0
  68. data/tracks/elixir/config.json +7 -0
  69. data/tracks/elixir/exercises/diffie-hellman/HINTS.md +10 -0
  70. data/tracks/elixir/exercises/diffie-hellman/diffie_hellman.exs +61 -0
  71. data/tracks/elixir/exercises/diffie-hellman/diffie_hellman_test.exs +99 -0
  72. data/tracks/elixir/exercises/diffie-hellman/example.exs +64 -0
  73. data/tracks/haskell/exercises/pov/src/POV.hs +2 -2
  74. data/tracks/haskell/exercises/pythagorean-triplet/src/Triplet.hs +6 -3
  75. data/tracks/haskell/exercises/queen-attack/src/Queens.hs +1 -1
  76. data/tracks/haskell/exercises/raindrops/src/Raindrops.hs +2 -1
  77. data/tracks/haskell/exercises/robot-name/src/Robot.hs +2 -2
  78. data/tracks/haskell/exercises/robot-simulator/src/Robot.hs +6 -6
  79. data/tracks/haskell/exercises/roman-numerals/src/Roman.hs +2 -1
  80. data/tracks/haskell/exercises/run-length-encoding/src/RunLength.hs +2 -2
  81. data/tracks/haskell/exercises/saddle-points/src/Matrix.hs +2 -1
  82. data/tracks/haskell/exercises/say/src/Say.hs +2 -1
  83. data/tracks/haskell/exercises/scrabble-score/src/Scrabble.hs +4 -2
  84. data/tracks/haskell/exercises/secret-handshake/src/SecretHandshake.hs +1 -1
  85. data/tracks/haskell/exercises/sgf-parsing/src/Sgf.hs +1 -1
  86. data/tracks/java/exercises/acronym/src/example/java/Acronym.java +11 -1
  87. data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +8 -9
  88. data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +8 -2
  89. data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +20 -13
  90. data/tracks/java/exercises/robot-name/src/test/java/RobotTest.java +6 -1
  91. data/tracks/javascript/README.md +1 -1
  92. data/tracks/javascript/docs/TESTS.md +9 -1
  93. data/tracks/kotlin/exercises/luhn/src/example/kotlin/Luhn.kt +18 -26
  94. data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +40 -38
  95. data/tracks/php/README.md +1 -1
  96. data/tracks/php/config.json +5 -0
  97. data/tracks/php/exercises/perfect-numbers/example.php +23 -0
  98. data/tracks/php/exercises/perfect-numbers/perfect-numbers_test.php +99 -0
  99. data/tracks/purescript/.travis.yml +1 -0
  100. data/tracks/purescript/bin/test.sh +33 -8
  101. data/tracks/purescript/config.json +7 -0
  102. data/tracks/purescript/exercises/meetup/bower.json +17 -0
  103. data/tracks/purescript/exercises/meetup/examples/src/Meetup.purs +37 -0
  104. data/tracks/purescript/exercises/meetup/src/Meetup.purs +11 -0
  105. data/tracks/purescript/exercises/meetup/test/Main.purs +395 -0
  106. data/tracks/python/README.md +7 -6
  107. data/tracks/python/docs/TOOLS.md +3 -3
  108. data/tracks/python/exercises/bracket-push/bracket_push_test.py +32 -15
  109. data/tracks/python/exercises/hamming/hamming_test.py +2 -0
  110. data/tracks/python/exercises/luhn/luhn_test.py +2 -0
  111. data/tracks/python/test/check-exercises.py +7 -1
  112. metadata +56 -20
  113. data/tracks/csharp/exercises/atbash-cipher/AtbashTest.cs +0 -17
  114. data/tracks/csharp/generators/BooleanTestMethod.cs +0 -36
  115. data/tracks/csharp/generators/TestMethodNameTransformer.cs +0 -11
  116. data/tracks/csharp/generators/TestedClassNameTransformer.cs +0 -11
  117. data/tracks/java/exercises/allergies/src/main/java/.keep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cd390706f6428039b6d1b9bd39c84baff013f05
4
- data.tar.gz: 30b3c130a0c8c06afeaf937fe37c1561bfa55b05
3
+ metadata.gz: faebef83368ee490d149ffbaefd180c65a4a0d3a
4
+ data.tar.gz: 507b81bff22dd1cabe62e51fd86ea00fd628203f
5
5
  SHA512:
6
- metadata.gz: b529eaeebfb7dd0c9b7daeaebf58d0a882b93d96ce33f0c3948baa9ec3f54377883fde02ccfc7675d7672baeb00abc8c4413ed4cfc2dce45e0d956ade187a398
7
- data.tar.gz: d4e8fce50a75e576c1518821023e6f23ea70e6856035989eeef22fd16db13e883f6d1492b3db2cf94955072df9b85eab382d96a9191713e55a7a8c4461e2a523
6
+ metadata.gz: a37814a2b504762359eafc95f1fb91d7b3ca0015875fa51708fe13c3e1d277a1b781a6d391ae3e1dee4d6d19db457e337a5817a5ba79306fd3c374dacad3c72c
7
+ data.tar.gz: 02b51347b6e00fd95e17695f9f24fe78e9cde2a28a12d77a511b67c9960299aa2bb1e26f323e9ae22e8be235901f3bb73a4687c6b58c34777f2d169132d56616
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.0.8.24"
2
+ VERSION = "2.0.8.26"
3
3
  end
data/tracks/c/config.json CHANGED
@@ -206,6 +206,15 @@
206
206
  "time functions",
207
207
  "preprocessor (x-macros in test)"
208
208
  ]
209
+ }, {
210
+ "difficulty": 2,
211
+ "slug": "nucleotide-count",
212
+ "topics": [
213
+ "control-flow (loops, switch, if-statements)",
214
+ "strings",
215
+ "text formatting",
216
+ "memory management"
217
+ ]
209
218
  }, {
210
219
  "difficulty": 2,
211
220
  "slug": "robot-simulator",
@@ -0,0 +1,15 @@
1
+ CFLAGS = -std=c99
2
+ CFLAGS += -Wall
3
+ CFLAGS += -Wextra
4
+ CFLAGS += -pedantic
5
+ CFLAGS += -Werror
6
+
7
+ test: tests.out
8
+ @./tests.out
9
+
10
+ clean:
11
+ rm -f *.o *.out
12
+
13
+ tests.out: src/nucleotide_count.c src/nucleotide_count.h test/test_nucleotide_count.c
14
+ @echo Compiling $@
15
+ @cc $(CFLAGS) src/nucleotide_count.c test/vendor/unity.c test/test_nucleotide_count.c -o tests.out
@@ -0,0 +1,43 @@
1
+ #include <stdlib.h>
2
+ #include <stdio.h>
3
+ #include <string.h>
4
+ #include <stdbool.h>
5
+ #include "nucleotide_count.h"
6
+
7
+ char *count(const char *dna_strand)
8
+ {
9
+ bool invalid_char = false;
10
+ size_t index;
11
+ size_t nucleotide_A_count = 0;
12
+ size_t nucleotide_C_count = 0;
13
+ size_t nucleotide_G_count = 0;
14
+ size_t nucleotide_T_count = 0;
15
+ char *count_results = calloc(1, 50);
16
+
17
+ for (index = 0; (index < strlen(dna_strand)) && (invalid_char == false);
18
+ index++) {
19
+ switch (dna_strand[index]) {
20
+ case 'A':
21
+ nucleotide_A_count++;
22
+ break;
23
+ case 'C':
24
+ nucleotide_C_count++;
25
+ break;
26
+ case 'G':
27
+ nucleotide_G_count++;
28
+ break;
29
+ case 'T':
30
+ nucleotide_T_count++;
31
+ break;
32
+ default:
33
+ invalid_char = true;
34
+ break;
35
+ }
36
+ }
37
+
38
+ if (!invalid_char) {
39
+ sprintf(count_results, "A:%zd C:%zd G:%zd T:%zd", nucleotide_A_count,
40
+ nucleotide_C_count, nucleotide_G_count, nucleotide_T_count);
41
+ }
42
+ return count_results;
43
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef _NUCLEOTIDE_COUNT_H
2
+ #define _NUCLEOTIDE_COUNT_H
3
+
4
+ char *count(const char *dna_strand);
5
+
6
+ #endif
@@ -0,0 +1,58 @@
1
+ #include "vendor/unity.h"
2
+ #include "../src/nucleotide_count.h"
3
+ #include <stdlib.h>
4
+ #include <string.h>
5
+
6
+ void test_strand_count(const char *dna_strand, const char *expected)
7
+ {
8
+ char *actual_count = count(dna_strand);
9
+
10
+ TEST_ASSERT_TRUE(strcmp(actual_count, expected) == 0);
11
+ free(actual_count);
12
+ }
13
+
14
+ void test_empty_strand(void)
15
+ {
16
+ const char *dna_strand = "";
17
+ const char *expected = "A:0 C:0 G:0 T:0";
18
+
19
+ test_strand_count(dna_strand, expected);
20
+ }
21
+
22
+ void test_repeated_nucleotide(void)
23
+ {
24
+ const char *dna_strand = "GGGGGGG";
25
+ const char *expected = "A:0 C:0 G:7 T:0";
26
+
27
+ test_strand_count(dna_strand, expected);
28
+ }
29
+
30
+ void test_multiple_nucleotides(void)
31
+ {
32
+ const char *dna_strand =
33
+ "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC";
34
+ const char *expected = "A:20 C:12 G:17 T:21";
35
+
36
+ test_strand_count(dna_strand, expected);
37
+ }
38
+
39
+ void test_invalid_nucleotide(void)
40
+ {
41
+ const char *dna_strand = "AGXXACT";
42
+ const char *expected = "";
43
+
44
+ test_strand_count(dna_strand, expected);
45
+ }
46
+
47
+ int main(void)
48
+ {
49
+ UnityBegin("test/test_rna_transcription.c");
50
+
51
+ RUN_TEST(test_empty_strand);
52
+ RUN_TEST(test_repeated_nucleotide);
53
+ RUN_TEST(test_multiple_nucleotides);
54
+ RUN_TEST(test_invalid_nucleotide);
55
+
56
+ UnityEnd();
57
+ return 0;
58
+ }