trackler 2.2.1.66 → 2.2.1.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/README.md +1 -0
- data/tracks/bash/exercises/anagram/anagram_tests.sh +16 -0
- data/tracks/bash/exercises/bob/bob_test.sh +28 -0
- data/tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh +3 -0
- data/tracks/bash/exercises/error-handling/error_handling_test.sh +5 -0
- data/tracks/bash/exercises/gigasecond/gigasecond_test.sh +10 -0
- data/tracks/bash/exercises/hamming/hamming_test.sh +15 -0
- data/tracks/bash/exercises/leap/leap_test.sh +10 -0
- data/tracks/bash/exercises/nucleotide-count/nucleotide_count_test.sh +4 -0
- data/tracks/bash/exercises/pangram/pangram_tests.sh +9 -0
- data/tracks/bash/exercises/phone-number/phone_number_tests.sh +13 -1
- data/tracks/bash/exercises/raindrops/raindrops_test.sh +16 -0
- data/tracks/bash/exercises/rna-transcription/rna_transcription_test.sh +8 -0
- data/tracks/bash/exercises/two-fer/two_fer_test.sh +3 -0
- data/tracks/bash/exercises/word-count/word_count_test.sh +9 -1
- data/tracks/c/exercises/hello-world/src/hello_world.c +0 -2
- data/tracks/c/exercises/sieve/test/test_sieve.c +13 -16
- data/tracks/erlang/config.json +4 -4
- data/tracks/fsharp/config.json +12 -0
- data/tracks/fsharp/exercises/Exercises.sln +6 -0
- data/tracks/fsharp/exercises/rotational-cipher/Example.fs +29 -0
- data/tracks/fsharp/exercises/rotational-cipher/Program.fs +1 -0
- data/tracks/fsharp/exercises/rotational-cipher/README.md +29 -0
- data/tracks/fsharp/exercises/rotational-cipher/RotationalCipher.fs +3 -0
- data/tracks/fsharp/exercises/rotational-cipher/RotationalCipher.fsproj +23 -0
- data/tracks/fsharp/exercises/rotational-cipher/RotationalCipherTest.fs +49 -0
- data/tracks/fsharp/generators/Generators.fs +3 -0
- data/tracks/go/exercises/grains/.meta/gen.go +99 -0
- data/tracks/go/exercises/grains/cases_test.go +64 -0
- data/tracks/go/exercises/grains/grains_test.go +4 -20
- data/tracks/go/exercises/space-age/space_age_test.go +3 -1
- data/tracks/java/config.json +12 -0
- data/tracks/java/exercises/beer-song/.meta/src/reference/java/BeerSong.java +4 -4
- data/tracks/java/exercises/diamond/src/main/java/DiamondPrinter.java +9 -0
- data/tracks/java/exercises/isbn-verifier/.meta/src/reference/java/IsbnVerifier.java +35 -0
- data/tracks/java/exercises/isbn-verifier/.meta/version +1 -0
- data/tracks/java/exercises/isbn-verifier/README.md +53 -0
- data/tracks/java/exercises/isbn-verifier/build.gradle +18 -0
- data/tracks/java/exercises/isbn-verifier/src/main/java/IsbnVerifier.java +7 -0
- data/tracks/java/exercises/isbn-verifier/src/test/java/IsbnVerifierTest.java +94 -0
- data/tracks/java/exercises/isogram/src/main/java/IsogramChecker.java +7 -0
- data/tracks/java/exercises/saddle-points/src/main/java/Matrix.java +13 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/kotlin/config.json +1 -1
- data/tracks/ocaml/exercises/all-your-base/example.ml +1 -1
- data/tracks/ocaml/exercises/all-your-base/test.ml +9 -9
- data/tracks/perl6/config.json +1 -1
- data/tracks/perl6/docs/SNIPPET.txt +2 -2
- data/tracks/perl6/exercises/anagram/Anagram.pm6 +4 -1
- data/tracks/perl6/exercises/anagram/Example.pm6 +4 -15
- data/tracks/perl6/exercises/anagram/anagram.t +2 -2
- data/tracks/perl6/exercises/anagram/example.yaml +7 -15
- data/tracks/php/config.json +12 -0
- data/tracks/php/exercises/run-length-encoding/README.md +42 -0
- data/tracks/php/exercises/run-length-encoding/example.php +60 -0
- data/tracks/php/exercises/run-length-encoding/run-length-encoding.php +20 -0
- data/tracks/php/exercises/run-length-encoding/run-length-encoding_test.php +65 -0
- data/tracks/purescript/.travis.yml +1 -1
- data/tracks/purescript/bin/test.sh +9 -2
- data/tracks/python/config.json +7 -16
- data/tracks/r/exercises/hello-world/test_hello-world.R +0 -8
- data/tracks/racket/config.json +1 -1
- data/tracks/swift/config.json +12 -2
- data/tracks/swift/exercises/diamond/Package.swift +5 -0
- data/tracks/swift/exercises/diamond/README.md +64 -0
- data/tracks/swift/exercises/diamond/Sources/Diamond.swift +1 -0
- data/tracks/swift/exercises/diamond/Sources/DiamondExample.swift +30 -0
- data/tracks/swift/exercises/diamond/Tests/DiamondTests/DiamondTests.swift +98 -0
- data/tracks/swift/exercises/diamond/Tests/LinuxMain.swift +6 -0
- metadata +29 -8
- data/tracks/java/exercises/diamond/src/main/java/.keep +0 -0
- data/tracks/java/exercises/isogram/src/main/java/.keep +0 -0
- data/tracks/python/exercises/parallel-letter-frequency/README.md +0 -24
- data/tracks/python/exercises/parallel-letter-frequency/example.py +0 -56
- data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency.py +0 -2
- data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency_test.py +0 -61
@@ -1,61 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
from collections import Counter
|
3
|
-
import unittest
|
4
|
-
|
5
|
-
from parallel_letter_frequency import calculate
|
6
|
-
|
7
|
-
|
8
|
-
class ParallelLetterFrequencyTest(unittest.TestCase):
|
9
|
-
def test_one_letter(self):
|
10
|
-
actual = calculate(['a'])
|
11
|
-
expected = {'a': 1}
|
12
|
-
self.assertDictEqual(actual, expected)
|
13
|
-
|
14
|
-
def test_case_insensitivity(self):
|
15
|
-
actual = calculate(['aA'])
|
16
|
-
expected = {'a': 2}
|
17
|
-
self.assertDictEqual(actual, expected)
|
18
|
-
|
19
|
-
def test_numbers(self):
|
20
|
-
actual = calculate(['012', '345', '6789'])
|
21
|
-
expected = {}
|
22
|
-
self.assertDictEqual(actual, expected)
|
23
|
-
|
24
|
-
def test_punctuations(self):
|
25
|
-
actual = calculate(['[]\;,', './{}|', ':"<>?'])
|
26
|
-
expected = {}
|
27
|
-
self.assertDictEqual(actual, expected)
|
28
|
-
|
29
|
-
def test_whitespaces(self):
|
30
|
-
actual = calculate([' ', '\t ', '\n\n'])
|
31
|
-
expected = {}
|
32
|
-
self.assertDictEqual(actual, expected)
|
33
|
-
|
34
|
-
def test_repeated_string_with_known_frequencies(self):
|
35
|
-
letter_frequency = 3
|
36
|
-
text_input = 'abc\n' * letter_frequency
|
37
|
-
actual = calculate(text_input.split('\n'))
|
38
|
-
expected = {'a': letter_frequency, 'b': letter_frequency,
|
39
|
-
'c': letter_frequency}
|
40
|
-
self.assertDictEqual(actual, expected)
|
41
|
-
|
42
|
-
def test_multiline_text(self):
|
43
|
-
text_input = "3 Quotes from Excerism Homepage:\n" + \
|
44
|
-
"\tOne moment you feel like you're\n" + \
|
45
|
-
"getting it. The next moment you're\n" + \
|
46
|
-
"stuck.\n" + \
|
47
|
-
"\tYou know what it’s like to be fluent.\n" + \
|
48
|
-
"Suddenly you’re feeling incompetent\n" + \
|
49
|
-
"and clumsy.\n" + \
|
50
|
-
"\tHaphazard, convoluted code is\n" + \
|
51
|
-
"infuriating, not to mention costly. That\n" + \
|
52
|
-
"slapdash explosion of complexity is an\n" + \
|
53
|
-
"expensive yak shave waiting to\n" + \
|
54
|
-
"happen."
|
55
|
-
actual = calculate(text_input.split('\n'))
|
56
|
-
expected = Counter([x for x in text_input.lower() if x.isalpha()])
|
57
|
-
self.assertDictEqual(actual, expected)
|
58
|
-
|
59
|
-
|
60
|
-
if __name__ == '__main__':
|
61
|
-
unittest.main()
|