trackler 2.2.1.155 → 2.2.1.156

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/lib/trackler/version.rb +1 -1
  4. data/problem-specifications/exercises/simple-cipher/canonical-data.json +147 -0
  5. data/tracks/clojure/exercises/hexadecimal/src/hexadecimal.clj +5 -0
  6. data/tracks/clojure/exercises/isogram/src/isogram.clj +5 -0
  7. data/tracks/clojure/exercises/kindergarten-garden/src/kindergarten-garden.clj +5 -0
  8. data/tracks/csharp/exercises/list-ops/Example.cs +14 -9
  9. data/tracks/csharp/exercises/list-ops/ListOps.cs +4 -4
  10. data/tracks/csharp/exercises/list-ops/ListOpsTest.cs +90 -88
  11. data/tracks/csharp/exercises/zipper/Example.cs +51 -43
  12. data/tracks/csharp/exercises/zipper/Zipper.cs +16 -19
  13. data/tracks/csharp/exercises/zipper/ZipperTest.cs +94 -45
  14. data/tracks/csharp/generators/Exercises/ListOps.cs +123 -0
  15. data/tracks/csharp/generators/Exercises/Zipper.cs +107 -0
  16. data/tracks/csharp/generators/Output/ValueFormatter.cs +14 -0
  17. data/tracks/delphi/config.json +10 -1
  18. data/tracks/delphi/config/maintainers.json +11 -11
  19. data/tracks/elisp/config.json +8 -0
  20. data/tracks/elisp/exercises/run-length-encoding/README.md +36 -0
  21. data/tracks/elisp/exercises/run-length-encoding/example.el +62 -0
  22. data/tracks/elisp/exercises/run-length-encoding/run-length-encoding-test.el +61 -0
  23. data/tracks/elisp/exercises/run-length-encoding/run-length-encoding.el +9 -0
  24. data/tracks/fsharp/docs/LEARNING.md +3 -0
  25. data/tracks/java/exercises/armstrong-numbers/.meta/hints.md +2 -0
  26. data/tracks/java/exercises/armstrong-numbers/README.md +6 -0
  27. data/tracks/java/exercises/bracket-push/.meta/version +1 -1
  28. data/tracks/java/exercises/bracket-push/src/test/java/BracketCheckerTest.java +7 -0
  29. data/tracks/java/exercises/isbn-verifier/.meta/version +1 -1
  30. data/tracks/java/exercises/isbn-verifier/src/test/java/IsbnVerifierTest.java +12 -1
  31. data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -1
  32. data/tracks/java/exercises/list-ops/.meta/version +1 -1
  33. data/tracks/java/exercises/list-ops/src/test/java/ListOpsTest.java +32 -1
  34. data/tracks/nim/config.json +13 -2
  35. data/tracks/nim/exercises/bob/bob_test.nim +1 -1
  36. data/tracks/nim/exercises/bob/example.nim +6 -3
  37. data/tracks/nim/exercises/bracket-push/README.md +11 -0
  38. data/tracks/nim/exercises/bracket-push/bracket_push_test.nim +52 -0
  39. data/tracks/nim/exercises/bracket-push/example.nim +22 -0
  40. data/tracks/ocaml/exercises/bracket-push/test.ml +3 -1
  41. data/tracks/ocaml/exercises/luhn/example.ml +8 -5
  42. data/tracks/ocaml/exercises/luhn/test.ml +3 -1
  43. data/tracks/powershell/.gitignore +2 -1
  44. data/tracks/powershell/config.json +46 -13
  45. data/tracks/powershell/exercises/bob/.version +1 -0
  46. data/tracks/powershell/exercises/bob/BobResponse.example.ps1 +28 -0
  47. data/tracks/powershell/exercises/bob/BobResponse.ps1 +8 -0
  48. data/tracks/powershell/exercises/bob/BobResponse.tests.ps1 +109 -0
  49. data/tracks/powershell/exercises/bob/README.md +20 -0
  50. data/tracks/powershell/exercises/nucleotide-count/.version +1 -0
  51. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.example.ps1 +36 -0
  52. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.ps1 +8 -0
  53. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.tests.ps1 +25 -0
  54. data/tracks/powershell/exercises/nucleotide-count/README.md +19 -0
  55. data/tracks/powershell/exercises/raindrops/.version +1 -0
  56. data/tracks/powershell/exercises/raindrops/README.md +24 -0
  57. data/tracks/powershell/exercises/raindrops/Raindrops.example.ps1 +32 -0
  58. data/tracks/powershell/exercises/raindrops/Raindrops.ps1 +8 -0
  59. data/tracks/powershell/exercises/raindrops/Raindrops.tests.ps1 +34 -0
  60. data/tracks/prolog/exercises/complex-numbers/complex_numbers_tests.plt +28 -29
  61. data/tracks/reasonml/.gitignore +4 -0
  62. data/tracks/reasonml/.travis.yml +5 -0
  63. data/tracks/reasonml/LICENSE +21 -0
  64. data/tracks/reasonml/README.md +67 -0
  65. data/tracks/reasonml/bin/fetch-configlet +32 -0
  66. data/tracks/reasonml/config.json +11 -0
  67. data/tracks/reasonml/config/exercise-readme-insert.md +0 -0
  68. data/tracks/reasonml/config/exercise_readme.go.tmpl +16 -0
  69. data/tracks/reasonml/config/maintainers.json +4 -0
  70. data/tracks/reasonml/docs/ABOUT.md +0 -0
  71. data/tracks/reasonml/docs/INSTALLATION.md +0 -0
  72. data/tracks/reasonml/docs/LEARNING.md +0 -0
  73. data/tracks/reasonml/docs/RESOURCES.md +0 -0
  74. data/tracks/reasonml/docs/TESTS.md +0 -0
  75. data/tracks/reasonml/img/.keep +0 -0
  76. data/tracks/scala/config.json +11 -0
  77. data/tracks/scala/exercises/armstrong-numbers/README.md +29 -0
  78. data/tracks/scala/exercises/armstrong-numbers/build.sbt +3 -0
  79. data/tracks/scala/exercises/armstrong-numbers/example.scala +7 -0
  80. data/tracks/scala/exercises/armstrong-numbers/src/main/scala/.keep +0 -0
  81. data/tracks/scala/exercises/armstrong-numbers/src/test/scala/ArmstrongNumbersTest.scala +44 -0
  82. data/tracks/scala/testgen/src/main/scala/ArmstrongNumbersTestGenerator.scala +33 -0
  83. data/tracks/scheme/config.json +8 -0
  84. data/tracks/scheme/exercises/atbash-cipher/README.md +36 -0
  85. data/tracks/scheme/exercises/atbash-cipher/atbash-cipher-test.scm +67 -0
  86. data/tracks/scheme/exercises/atbash-cipher/atbash-cipher.scm +8 -0
  87. data/tracks/scheme/exercises/atbash-cipher/example.scm +40 -0
  88. metadata +57 -3
  89. data/tracks/python/exercises/rna-transcription/.meta/hints.md +0 -1
@@ -0,0 +1,107 @@
1
+ using System;
2
+ using System.Linq;
3
+ using System.Text;
4
+ using Generators.Output;
5
+ using Humanizer;
6
+ using Newtonsoft.Json.Linq;
7
+
8
+ namespace Generators.Exercises
9
+ {
10
+ public class Zipper : GeneratorExercise
11
+ {
12
+ protected override string RenderTestMethodBodyArrange(TestMethodBody testMethodBody)
13
+ {
14
+ var arrange = new StringBuilder();
15
+
16
+ var tree = RenderTree(testMethodBody.CanonicalDataCase.Input["initialTree"]);
17
+ arrange.AppendLine($"var tree = {tree};");
18
+ arrange.AppendLine("var sut = Zipper.FromTree(tree);");
19
+
20
+ var operations = RenderOperations(testMethodBody.CanonicalDataCase.Input["operations"]);
21
+ arrange.AppendLine($"var actual = sut{operations};");
22
+
23
+ return arrange.ToString();
24
+ }
25
+
26
+ protected override string RenderTestMethodBodyAssert(TestMethodBody testMethodBody)
27
+ {
28
+ var assert = new StringBuilder();
29
+
30
+ var expected = RenderExpected(testMethodBody.CanonicalDataCase.Expected);
31
+ if (expected == null)
32
+ {
33
+ assert.AppendLine("Assert.Null(actual);");
34
+ }
35
+ else
36
+ {
37
+ assert.AppendLine($"var expected = {expected};");
38
+ assert.AppendLine("Assert.Equal(expected, actual);");
39
+ }
40
+
41
+ return assert.ToString();
42
+ }
43
+
44
+ private static string RenderTree(dynamic tree)
45
+ {
46
+ if (tree == null)
47
+ {
48
+ return "null";
49
+ }
50
+
51
+ var value = tree["value"];
52
+ var left = tree["left"] == null ? "null" : RenderTree(tree["left"]);
53
+ var right = tree["right"] == null ? "null" : RenderTree(tree["right"]);
54
+
55
+ return $"new BinTree({value}, {left}, {right})";
56
+ }
57
+
58
+ private static string RenderOperations(dynamic operations)
59
+ {
60
+ if (operations.Length == 0)
61
+ {
62
+ return "";
63
+ }
64
+
65
+ return "." + string.Join(".", ((object[])operations).Select(RenderOperation));
66
+ }
67
+
68
+ private static string RenderOperation(dynamic operation)
69
+ {
70
+ var operationType = (string)operation["operation"];
71
+
72
+ switch (operationType)
73
+ {
74
+ case "set_value":
75
+ return $"SetValue({operation["item"]})";
76
+ case "set_left":
77
+ return $"SetLeft({RenderTree(operation["item"])})";
78
+ case "set_right":
79
+ return $"SetRight({RenderTree(operation["item"])})";
80
+ default:
81
+ return $"{operationType.Pascalize()}()";
82
+ }
83
+ }
84
+
85
+ private static string RenderExpected(dynamic expected)
86
+ {
87
+ switch (expected["type"])
88
+ {
89
+ case "int":
90
+ return expected["value"].ToString();
91
+ case "zipper":
92
+ if (expected.TryGetValue("value", out dynamic value) && value == null)
93
+ {
94
+ return null;
95
+ }
96
+
97
+ var tree = RenderTree(expected["initialTree"]);
98
+ var operations = RenderOperations(expected["operations"]);
99
+ return $"Zipper.FromTree({tree}){operations}";
100
+ case "tree":
101
+ return RenderTree(expected["value"]);
102
+ default:
103
+ throw new ArgumentException("Unknown expected type");
104
+ }
105
+ }
106
+ }
107
+ }
@@ -19,6 +19,8 @@ public static string Format(object val)
19
19
  case char c: return c.Format();
20
20
  case Enum enumeration: return enumeration.Format();
21
21
  case Tuple<string, object> tuple: return tuple.Format();
22
+ case List<int> ints: return ints.Format();
23
+ case List<object> objects: return objects.Format();
22
24
  case IEnumerable<int> ints: return ints.Format();
23
25
  case IEnumerable<string> strings: return strings.Format();
24
26
  case IEnumerable<UnescapedValue> unescapedValues when unescapedValues.Any(): return unescapedValues.Format();
@@ -30,6 +32,7 @@ public static string Format(object val)
30
32
  case int[,] multidimensionalArray: return multidimensionalArray.Format();
31
33
  case IEnumerable<ValueTuple<int, int>> tuples: return tuples.Format();
32
34
  case IEnumerable<Tuple<string, object>> tuples: return tuples.Format();
35
+ case IEnumerable<object> objects: return objects.Format();
33
36
  default: return val?.ToString();
34
37
  }
35
38
  }
@@ -71,6 +74,8 @@ public static string[] FormatVariable(object val, string name)
71
74
 
72
75
  private static string Format(this float flt) => flt.ToString(CultureInfo.InvariantCulture);
73
76
 
77
+ private static string Format(this int i) => i.ToString(CultureInfo.InvariantCulture);
78
+
74
79
  private static string Format(this ulong ulng) => $"{ulng}UL";
75
80
 
76
81
  private static string Format(this Enum @enumeration) =>
@@ -85,6 +90,15 @@ public static string[] FormatVariable(object val, string name)
85
90
  private static string Format(this IEnumerable<string> strings) =>
86
91
  strings.Any() ? $"new[] {{ {string.Join(", ", strings.Select(Format))} }}" : "new string[0]";
87
92
 
93
+ private static string Format(this IEnumerable<object> objects) =>
94
+ objects.Any() ? $"new[] {{ {string.Join(", ", objects.Select(Format))} }}" : "new object[0]";
95
+
96
+ private static string Format(this List<int> ints) =>
97
+ ints.Any() ? $"new List<int> {{ {string.Join(", ", ints.Select(Format))} }}" : "new List<int>()";
98
+
99
+ private static string Format(this List<object> objects) =>
100
+ objects.Any() ? $"new List<object> {{ {string.Join(", ", objects.Select(Format))} }}" : "new List<object>()";
101
+
88
102
  private static string Format(this IEnumerable<UnescapedValue> unescapedValues) =>
89
103
  $"new[] {{ {string.Join(", ", unescapedValues.Select(Format))} }}";
90
104
 
@@ -17,6 +17,7 @@
17
17
  "slug": "two-fer",
18
18
  "uuid": "60eb0882-495d-45f4-8d38-5b10d8851cf6",
19
19
  "core": false,
20
+ "unlocked_by": null,
20
21
  "difficulty": 1,
21
22
  "topics": [
22
23
  "optional_values",
@@ -48,6 +49,7 @@
48
49
  "slug": "leap",
49
50
  "uuid": "9e54a998-450c-4020-834e-eaa77f909744",
50
51
  "core": true,
52
+ "unlocked_by": null,
51
53
  "difficulty": 1,
52
54
  "topics": [
53
55
  "integers"
@@ -124,6 +126,7 @@
124
126
  "slug": "nucleotide-count",
125
127
  "uuid": "f2fae277-db73-482c-ac3a-496237ad5a42",
126
128
  "core": true,
129
+ "unlocked_by": null,
127
130
  "difficulty": 2,
128
131
  "topics": [
129
132
  "dictionaries",
@@ -256,6 +259,7 @@
256
259
  "slug": "clock",
257
260
  "uuid": "0223dfe4-3ff4-4f4e-8cd2-821e1fd50217",
258
261
  "core": true,
262
+ "unlocked_by": null,
259
263
  "difficulty": 3,
260
264
  "topics": [
261
265
  "structural_equality",
@@ -277,6 +281,7 @@
277
281
  "slug": "allergies",
278
282
  "uuid": "65214085-edfc-4ee7-a286-eca225b57ea3",
279
283
  "core": true,
284
+ "unlocked_by": null,
280
285
  "difficulty": 4,
281
286
  "topics": [
282
287
  "bitwise_operations",
@@ -287,6 +292,7 @@
287
292
  "slug": "saddle-points",
288
293
  "uuid": "78166582-6df9-4076-bd37-53230cd78f71",
289
294
  "core": true,
295
+ "unlocked_by": null,
290
296
  "difficulty": 4,
291
297
  "topics": [
292
298
  "arrays",
@@ -298,6 +304,7 @@
298
304
  "slug": "circular-buffer",
299
305
  "uuid": "f949b958-d2e0-4f21-a6db-12ba89f8ab57",
300
306
  "core": true,
307
+ "unlocked_by": null,
301
308
  "difficulty": 5,
302
309
  "topics": [
303
310
  "classes",
@@ -330,6 +337,7 @@
330
337
  "slug": "roman-numerals",
331
338
  "uuid": "51d6c5fc-6bde-4b78-842b-518346649431",
332
339
  "core": true,
340
+ "unlocked_by": null,
333
341
  "difficulty": 5,
334
342
  "topics": [
335
343
  "control_flow_loops",
@@ -362,6 +370,7 @@
362
370
  "slug": "book-store",
363
371
  "uuid": "d471f0d3-6d7c-4abe-bf31-712fb0cadea7",
364
372
  "core": true,
373
+ "unlocked_by": null,
365
374
  "difficulty": 6,
366
375
  "topics": [
367
376
  "arrays",
@@ -395,4 +404,4 @@
395
404
  ]
396
405
  }
397
406
  ]
398
- }
407
+ }
@@ -2,24 +2,24 @@
2
2
  "docs_url": "https://github.com/exercism/docs/blob/master/maintaining-a-track/maintainer-configuration.md",
3
3
  "maintainers": [
4
4
  {
5
- "alumnus": false,
6
- "avatar_url": null,
7
- "bio": null,
8
5
  "github_username": "kotp",
6
+ "alumnus": false,
7
+ "show_on_website": false,
8
+ "name": null,
9
9
  "link_text": null,
10
10
  "link_url": null,
11
- "name": null,
12
- "show_on_website": false
11
+ "avatar_url": null,
12
+ "bio": null
13
13
  },
14
14
  {
15
- "alumnus": false,
16
- "avatar_url": null,
17
- "bio": "I have been using Delphi professionally since 1996. At my day job I develop software used in the control of various types of test machines used by the auto industry. Exercism is my first real push into Open Source and I'm happy to have this opportunity to teach and share the virtues of Delphi with others.",
18
15
  "github_username": "rpottsoh",
16
+ "alumnus": false,
17
+ "show_on_website": true,
18
+ "name": "Ryan Potts",
19
19
  "link_text": null,
20
20
  "link_url": null,
21
- "name": "Ryan Potts",
22
- "show_on_website": true
21
+ "avatar_url": null,
22
+ "bio": "I have been using Delphi professionally since 1996. At my day job I develop software used in the control of various types of test machines used by the auto industry. Exercism is my first real push into Open Source and I'm happy to have this opportunity to teach and share the virtues of Delphi with others."
23
23
  }
24
24
  ]
25
- }
25
+ }
@@ -192,6 +192,14 @@
192
192
  "topics": null,
193
193
  "unlocked_by": null,
194
194
  "uuid": "059141f0-f28d-4d10-a03a-7852dbfc2d2e"
195
+ },
196
+ {
197
+ "core": false,
198
+ "difficulty": 1,
199
+ "slug": "run-length-encoding",
200
+ "topics": null,
201
+ "unlocked_by": null,
202
+ "uuid": "9e8f98f0-6fff-4389-a9a2-9ae43edefa21"
195
203
  }
196
204
  ],
197
205
  "foregone": [],
@@ -0,0 +1,36 @@
1
+ # Run Length Encoding
2
+
3
+ Implement run-length encoding and decoding.
4
+
5
+ Run-length encoding (RLE) is a simple form of data compression, where runs
6
+ (consecutive data elements) are replaced by just one data value and count.
7
+
8
+ For example we can represent the original 53 characters with only 13.
9
+
10
+ ```text
11
+ "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB" -> "12WB12W3B24WB"
12
+ ```
13
+
14
+ RLE allows the original data to be perfectly reconstructed from
15
+ the compressed data, which makes it a lossless data compression.
16
+
17
+ ```text
18
+ "AABCCCDEEEE" -> "2AB3CD4E" -> "AABCCCDEEEE"
19
+ ```
20
+
21
+ For simplicity, you can assume that the unencoded string will only contain
22
+ the letters A through Z (either lower or upper case) and whitespace. This way
23
+ data to be encoded will never contain any numbers and numbers inside data to
24
+ be decoded always represent the count for the following character.
25
+
26
+ ## General help
27
+
28
+ For more detailed information about running tests, code style and linting,
29
+ please see the [help page](http://exercism.io/languages/clojure).
30
+
31
+ ## Source
32
+
33
+ Wikipedia [https://en.wikipedia.org/wiki/Run-length_encoding](https://en.wikipedia.org/wiki/Run-length_encoding)
34
+
35
+ ## Submitting Incomplete Solutions
36
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,62 @@
1
+ ;;; run-length-encoding.el --- run-length-encoding Exercise (exercism)
2
+
3
+ ;;; Commentary:
4
+
5
+ ;;; Code:
6
+
7
+
8
+ (defun run-length-group (s)
9
+ "return list of character run counts"
10
+ (let ((case-fold-search nil)
11
+ groups)
12
+ (with-temp-buffer
13
+ (insert s)
14
+ (goto-char (point-min))
15
+ (while (re-search-forward "\\(.\\)\\1*" nil t)
16
+ (push (cons
17
+ (length (match-string 0))
18
+ (match-string 1))
19
+ groups)))
20
+ (nreverse groups)))
21
+
22
+ ;; (run-length-group "bbaaaac")
23
+
24
+
25
+ (defun run-length-encode (s)
26
+ "encodes a string with run-length-encoding"
27
+ (mapconcat (lambda (v)
28
+ (if (= (car v) 1)
29
+ (cdr v)
30
+ (format "%d%s" (car v) (cdr v))))
31
+ (run-length-group s)
32
+ ""))
33
+
34
+ ;; "2a3b4c" (run-length-encode "aabbbcccc")
35
+
36
+
37
+ (defun run-length-parse (s)
38
+ "split string into pairs containing a count and a character"
39
+ (let (rtn)
40
+ (with-temp-buffer
41
+ (insert s)
42
+ (goto-char (point-min))
43
+ (while (re-search-forward "\\([0-9]*\\)\\(.\\)" nil t)
44
+ (push (cons
45
+ (string-to-number (match-string 1))
46
+ (string-to-char (match-string 2)))
47
+ rtn)))
48
+ (nreverse rtn)))
49
+
50
+ ;; (run-length-parse "2a3b4cz")
51
+
52
+
53
+ (defun run-length-decode (s)
54
+ "decodes a run-length-encoded string"
55
+ (mapconcat (lambda (n)
56
+ (make-vector (if (= (car n) 0) 1 (car n)) (cdr n)))
57
+ (run-length-parse s)
58
+ ""))
59
+
60
+
61
+ (provide 'run-length-encoding)
62
+ ;;; run-length-encoding.el ends here
@@ -0,0 +1,61 @@
1
+ ;;; run-length-encoding-test.el --- Tests for run-length-encoding (exercism)
2
+
3
+ ;;; Commentary:
4
+
5
+ ;;; Code:
6
+
7
+ (load-file "run-length-encoding.el")
8
+
9
+ (ert-deftest encode-empty-string ()
10
+ "encode an empty string"
11
+ (should (string= (run-length-encode "") "")))
12
+
13
+ (ert-deftest encode-single-characters-without-count ()
14
+ "encode single characters without count"
15
+ (should (string= (run-length-encode "XYZ") "XYZ")))
16
+
17
+ (ert-deftest encode-string-with-no-single-characters ()
18
+ "encode string with no single characters"
19
+ (should (string= (run-length-encode "AABBBCCCC") "2A3B4C")))
20
+
21
+ (ert-deftest encode-string-with-single-and-mixed-characters ()
22
+ "encode string with single and mixed characters"
23
+ (should (string= (run-length-encode "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB") "12WB12W3B24WB")))
24
+
25
+ (ert-deftest encode-multiple-whitespace ()
26
+ "encode string with whitespace characters mixed in it"
27
+ (should (string= (run-length-encode " hsqq qww ") "2 hs2q q2w2 ")))
28
+
29
+ (ert-deftest encode-lowercase ()
30
+ "encode string with lowercase characters"
31
+ (should (string= (run-length-encode "aabbbcccc") "2a3b4c")))
32
+
33
+ (ert-deftest decode-empty-string ()
34
+ "decode empty string"
35
+ (should (string= (run-length-decode "") "")))
36
+
37
+ (ert-deftest decode-single-characters ()
38
+ "decode string with single characters only"
39
+ (should (string= (run-length-decode "XYZ") "XYZ")))
40
+
41
+ (ert-deftest decode-no-single-characters ()
42
+ "decode string with no single characters"
43
+ (should (string= (run-length-decode "2A3B4C") "AABBBCCCC")))
44
+
45
+ (ert-deftest decode-single-and-repeated-characters ()
46
+ "decode string with single and repeated characters"
47
+ (should (string= (run-length-decode "12WB12W3B24WB") "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")))
48
+
49
+ (ert-deftest decode-lowercase ()
50
+ "decode string with lowercase characters"
51
+ (should (string= (run-length-decode "2a3b4c") "aabbbcccc")))
52
+
53
+ (ert-deftest decode-mixed-whitespace ()
54
+ "decode string with mixed whitespace characters in it"
55
+ (should (string= (run-length-decode "2 hs2q q2w2 ") " hsqq qww ")))
56
+
57
+ (ert-deftest consistency ()
58
+ "Encode a string and then decode it. Should return the same one."
59
+ (should (string= (run-length-decode (run-length-encode "zzz ZZ zZ")) "zzz ZZ zZ")))
60
+
61
+ ;;; run-length-encoding-test.el ends here
@@ -0,0 +1,9 @@
1
+ ;;; run-length-encoding.el --- run-length-encoding Exercise (exercism)
2
+
3
+ ;;; Commentary:
4
+
5
+ ;;; Code:
6
+
7
+
8
+ (provide 'run-length-encoding)
9
+ ;;; run-length-encoding.el ends here