trackler 2.2.1.160 → 2.2.1.161
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/tracks/ballerina/.gitignore +4 -0
- data/tracks/ballerina/.travis.yml +5 -0
- data/tracks/ballerina/LICENSE +21 -0
- data/tracks/ballerina/README.md +67 -0
- data/tracks/ballerina/bin/fetch-configlet +32 -0
- data/tracks/ballerina/config.json +11 -0
- data/tracks/ballerina/config/exercise-readme-insert.md +0 -0
- data/tracks/ballerina/config/exercise_readme.go.tmpl +16 -0
- data/tracks/ballerina/config/maintainers.json +4 -0
- data/tracks/ballerina/docs/ABOUT.md +0 -0
- data/tracks/ballerina/docs/INSTALLATION.md +0 -0
- data/tracks/ballerina/docs/LEARNING.md +0 -0
- data/tracks/ballerina/docs/RESOURCES.md +0 -0
- data/tracks/ballerina/docs/TESTS.md +0 -0
- data/tracks/ballerina/img/.keep +0 -0
- data/tracks/c/config.json +1 -1
- data/tracks/kotlin/config.json +400 -86
- data/tracks/kotlin/config/maintainers.json +10 -0
- data/tracks/objective-c/config.json +208 -208
- data/tracks/objective-c/config/maintainers.json +16 -16
- data/tracks/objective-c/docs/ABOUT.md +5 -1
- data/tracks/powershell/config.json +1 -1
- data/tracks/powershell/exercises/reverse-string/ReverseString.example.ps1 +13 -0
- data/tracks/powershell/exercises/reverse-string/ReverseString.ps1 +13 -1
- data/tracks/powershell/exercises/sum-of-multiples/SumOfMultiples.example.ps1 +18 -0
- data/tracks/powershell/exercises/sum-of-multiples/SumOfMultiples.ps1 +18 -0
- data/tracks/prolog/config.json +31 -63
- data/tracks/prolog/config/maintainers.json +8 -8
- data/tracks/prolog/docs/SNIPPET.txt +10 -5
- data/tracks/python/config.json +1 -0
- data/tracks/python/docs/ABOUT.md +8 -8
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +1 -1
- data/tracks/python/exercises/allergies/allergies_test.py +1 -1
- data/tracks/python/exercises/alphametics/alphametics_test.py +1 -1
- data/tracks/python/exercises/anagram/anagram_test.py +1 -1
- data/tracks/python/exercises/armstrong-numbers/armstrong_numbers_test.py +1 -1
- data/tracks/python/exercises/bank-account/bank_account_test.py +1 -1
- data/tracks/python/exercises/beer-song/beer_song_test.py +1 -1
- data/tracks/python/exercises/binary-search-tree/binary_search_tree_test.py +1 -1
- data/tracks/python/exercises/binary-search/binary_search_test.py +1 -1
- data/tracks/python/exercises/binary/binary_test.py +1 -1
- data/tracks/python/exercises/bob/bob_test.py +1 -1
- data/tracks/python/exercises/book-store/book_store_test.py +1 -1
- data/tracks/python/exercises/bowling/bowling_test.py +1 -1
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +1 -1
- data/tracks/python/exercises/collatz-conjecture/collatz_conjecture_test.py +1 -1
- data/tracks/python/exercises/diamond/diamond_test.py +1 -1
- data/tracks/python/exercises/etl/etl_test.py +1 -1
- data/tracks/python/exercises/flatten-array/flatten_array_test.py +1 -1
- data/tracks/python/exercises/grade-school/grade_school_test.py +1 -1
- data/tracks/python/exercises/hello-world/hello_world_test.py +1 -1
- data/tracks/python/exercises/house/house_test.py +1 -1
- data/tracks/python/exercises/isbn-verifier/isbn_verifier_test.py +1 -1
- data/tracks/python/exercises/isogram/isogram_test.py +1 -1
- data/tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py +1 -1
- data/tracks/python/exercises/largest-series-product/largest_series_product_test.py +1 -1
- data/tracks/python/exercises/leap/leap_test.py +1 -1
- data/tracks/python/exercises/linked-list/linked_list_test.py +1 -1
- data/tracks/python/exercises/luhn/luhn_test.py +1 -1
- data/tracks/python/exercises/markdown/markdown_test.py +1 -1
- data/tracks/python/exercises/nth-prime/nth_prime_test.py +1 -1
- data/tracks/python/exercises/nucleotide-count/nucleotide_count_test.py +1 -1
- data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +1 -1
- data/tracks/python/exercises/palindrome-products/palindrome_products_test.py +1 -1
- data/tracks/python/exercises/pangram/pangram_test.py +1 -1
- data/tracks/python/exercises/phone-number/phone_number_test.py +1 -1
- data/tracks/python/exercises/pig-latin/pig_latin_test.py +1 -1
- data/tracks/python/exercises/point-mutations/point_mutations_test.py +1 -1
- data/tracks/python/exercises/protein-translation/protein_translation_test.py +1 -1
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher_test.py +1 -1
- data/tracks/python/exercises/rational-numbers/rational_numbers_test.py +1 -1
- data/tracks/python/exercises/react/react_test.py +1 -1
- data/tracks/python/exercises/rectangles/rectangles_test.py +1 -1
- data/tracks/python/exercises/reverse-string/reverse_string_test.py +1 -1
- data/tracks/python/exercises/rna-transcription/rna_transcription_test.py +1 -1
- data/tracks/python/exercises/robot-name/robot_name_test.py +1 -1
- data/tracks/python/exercises/robot-simulator/robot_simulator_test.py +1 -1
- data/tracks/python/exercises/roman-numerals/roman_numerals_test.py +1 -1
- data/tracks/python/exercises/rotational-cipher/rotational_cipher_test.py +1 -1
- data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +1 -1
- data/tracks/python/exercises/saddle-points/saddle_points_test.py +1 -1
- data/tracks/python/exercises/scrabble-score/scrabble_score_test.py +1 -1
- data/tracks/python/exercises/secret-handshake/secret_handshake_test.py +1 -1
- data/tracks/python/exercises/simple-cipher/simple_cipher_test.py +1 -1
- data/tracks/python/exercises/simple-linked-list/simple_linked_list_test.py +1 -1
- data/tracks/python/exercises/tournament/tournament_test.py +1 -1
- data/tracks/python/exercises/transpose/transpose_test.py +1 -1
- data/tracks/python/exercises/tree-building/tree_building_test.py +1 -1
- data/tracks/python/exercises/twelve-days/twelve_days_test.py +1 -3
- data/tracks/python/exercises/two-fer/two_fer_test.py +1 -1
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +1 -1
- data/tracks/python/exercises/word-count/word_count_test.py +1 -1
- data/tracks/python/exercises/word-search/word_search_test.py +1 -1
- data/tracks/python/exercises/yacht/yacht_test.py +1 -1
- data/tracks/swift/config.json +369 -353
- data/tracks/swift/config/maintainers.json +16 -16
- data/tracks/vimscript/docs/ABOUT.md +23 -34
- metadata +18 -2
@@ -5,7 +5,7 @@ from alphametics import solve
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class AlphameticsTest(unittest.TestCase):
|
9
9
|
def test_puzzle_with_three_letters(self):
|
10
10
|
self.assertEqual(solve("I + BB == ILL"), {"I": 1, "B": 9, "L": 0})
|
11
11
|
|
@@ -5,7 +5,7 @@ from anagram import detect_anagrams
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class AnagramTest(unittest.TestCase):
|
9
9
|
def test_no_matches(self):
|
10
10
|
candidates = ["hello", "world", "zombies", "pants"]
|
11
11
|
self.assertEqual(detect_anagrams("diaper", candidates), [])
|
@@ -5,7 +5,7 @@ from armstrong_numbers import is_armstrong
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class ArmstrongNumbersTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_single_digit_numbers_are_armstrong_numbers(self):
|
11
11
|
self.assertIs(is_armstrong(5), True)
|
@@ -5,7 +5,7 @@ from beer_song import recite
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BeerSongTest(unittest.TestCase):
|
9
9
|
def test_first_generic_verse(self):
|
10
10
|
expected = [
|
11
11
|
"99 bottles of beer on the wall, 99 bottles of beer.",
|
@@ -5,7 +5,7 @@ from binary_search_tree import BinarySearchTree, TreeNode
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BinarySearchTreeTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_data_is_retained(self):
|
11
11
|
expected = TreeNode('4', None, None)
|
@@ -5,7 +5,7 @@ from binary_search import binary_search
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BinarySearchTest(unittest.TestCase):
|
9
9
|
def test_finds_value_in_array_with_one_element(self):
|
10
10
|
self.assertEqual(binary_search([6], 6), 0)
|
11
11
|
|
@@ -5,7 +5,7 @@ import bob
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BobTest(unittest.TestCase):
|
9
9
|
def test_stating_something(self):
|
10
10
|
self.assertEqual(bob.hey("Tom-ay-to, tom-aaaah-to."), "Whatever.")
|
11
11
|
|
@@ -5,7 +5,7 @@ from book_store import calculate_total
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BookStoreTest(unittest.TestCase):
|
9
9
|
def test_only_a_single_book(self):
|
10
10
|
self.assertEqual(calculate_total([1]), 800)
|
11
11
|
|
@@ -5,7 +5,7 @@ from bowling import BowlingGame
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BowlingTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def roll(self, rolls):
|
11
11
|
[self.game.roll(roll) for roll in rolls]
|
@@ -5,7 +5,7 @@ from bracket_push import is_paired
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class BracketPushTest(unittest.TestCase):
|
9
9
|
def test_paired_square_brackets(self):
|
10
10
|
self.assertEqual(is_paired("[]"), True)
|
11
11
|
|
@@ -5,7 +5,7 @@ from collatz_conjecture import collatz_steps
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class CollatzConjectureTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_zero_steps_for_one(self):
|
11
11
|
self.assertEqual(collatz_steps(1), 0)
|
@@ -5,7 +5,7 @@ from diamond import make_diamond
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class DiamondTest(unittest.TestCase):
|
9
9
|
def test_degenerate_case_with_a_single_row(self):
|
10
10
|
self.assertMultiLineEqual(make_diamond('A'), 'A\n')
|
11
11
|
|
@@ -5,7 +5,7 @@ from etl import transform
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class EtlTest(unittest.TestCase):
|
9
9
|
def test_a_single_letter(self):
|
10
10
|
self.assertEqual(transform({1: ['A']}), {'a': 1})
|
11
11
|
|
@@ -5,7 +5,7 @@ from flatten_array import flatten
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class FlattenArrayTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_no_nesting(self):
|
11
11
|
self.assertEqual(flatten([0, 1, 2]), [0, 1, 2])
|
@@ -5,7 +5,7 @@ from types import GeneratorType
|
|
5
5
|
from grade_school import School
|
6
6
|
|
7
7
|
|
8
|
-
class
|
8
|
+
class GradeSchoolTest(unittest.TestCase):
|
9
9
|
def setUp(self):
|
10
10
|
# assertCountEqual is py3, py2 only knowns assetItemsEqual
|
11
11
|
if not hasattr(self, 'assertCountEqual'):
|
@@ -5,7 +5,7 @@ import hello_world
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class HelloWorldTest(unittest.TestCase):
|
9
9
|
def test_hello(self):
|
10
10
|
self.assertEqual(hello_world.hello(), 'Hello, World!')
|
11
11
|
|
@@ -7,7 +7,7 @@ from house import recite
|
|
7
7
|
|
8
8
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
|
9
9
|
|
10
|
-
class
|
10
|
+
class HouseTest(unittest.TestCase):
|
11
11
|
def test_verse_one(self):
|
12
12
|
expected = ["This is the house that Jack built."]
|
13
13
|
self.assertEqual(recite(1, 1), expected)
|
@@ -5,7 +5,7 @@ from isbn_verifier import verify
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.4.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class IsbnVerifierTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_valid_isbn_number(self):
|
11
11
|
self.assertIs(verify('3-598-21508-8'), True)
|
@@ -5,7 +5,7 @@ from kindergarten_garden import Garden
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class KindergartenGardenTest(unittest.TestCase):
|
9
9
|
def test_garden_with_single_student(self):
|
10
10
|
self.assertEqual(
|
11
11
|
Garden("RC\nGG").plants("Alice"),
|
@@ -13,7 +13,7 @@ from largest_series_product import largest_product
|
|
13
13
|
|
14
14
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
15
15
|
|
16
|
-
class
|
16
|
+
class LargestSeriesProductTest(unittest.TestCase):
|
17
17
|
def test_finds_the_largest_product_if_span_equals_length(self):
|
18
18
|
self.assertEqual(largest_product("29", 2), 18)
|
19
19
|
|
@@ -5,7 +5,7 @@ from leap import is_leap_year
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class LeapTest(unittest.TestCase):
|
9
9
|
def test_year_not_divisible_by_4(self):
|
10
10
|
self.assertIs(is_leap_year(2015), False)
|
11
11
|
|
@@ -7,7 +7,7 @@ from luhn import Luhn
|
|
7
7
|
|
8
8
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
9
9
|
|
10
|
-
class
|
10
|
+
class LuhnTest(unittest.TestCase):
|
11
11
|
def test_single_digit_strings_can_not_be_valid(self):
|
12
12
|
self.assertIs(Luhn("1").is_valid(), False)
|
13
13
|
|
@@ -4,7 +4,7 @@ from markdown import parse_markdown
|
|
4
4
|
|
5
5
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
6
6
|
|
7
|
-
class
|
7
|
+
class MarkdownTest(unittest.TestCase):
|
8
8
|
|
9
9
|
def test_paragraph(self):
|
10
10
|
self.assertEqual(parse_markdown('This will be a paragraph'),
|
@@ -5,7 +5,7 @@ from nth_prime import nth_prime
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class NthPrimeTest(unittest.TestCase):
|
9
9
|
def test_first_prime(self):
|
10
10
|
self.assertEqual(nth_prime(1), 2)
|
11
11
|
|
@@ -13,7 +13,7 @@ from ocr_numbers import convert
|
|
13
13
|
|
14
14
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
15
15
|
|
16
|
-
class
|
16
|
+
class OcrNumbersTest(unittest.TestCase):
|
17
17
|
def test_recognizes_0(self):
|
18
18
|
self.assertEqual(convert([" _ ",
|
19
19
|
"| |",
|
@@ -18,7 +18,7 @@ from palindrome_products import smallest_palindrome, largest_palindrome
|
|
18
18
|
|
19
19
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
20
20
|
|
21
|
-
class
|
21
|
+
class PalindromeProductsTest(unittest.TestCase):
|
22
22
|
def test_smallest_palindrome_from_single_digit_factors(self):
|
23
23
|
value, factors = smallest_palindrome(min_factor=1, max_factor=9)
|
24
24
|
self.assertEqual(value, 1)
|
@@ -5,7 +5,7 @@ from pangram import is_pangram
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class PangramTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_sentence_empty(self):
|
11
11
|
self.assertIs(is_pangram(''), False)
|
@@ -5,7 +5,7 @@ from phone_number import Phone
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class PhoneNumberTest(unittest.TestCase):
|
9
9
|
def test_cleans_number(self):
|
10
10
|
number = Phone("(223) 456-7890").number
|
11
11
|
self.assertEqual(number, "2234567890")
|
@@ -5,7 +5,7 @@ from pig_latin import translate
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class PigLatinTest(unittest.TestCase):
|
9
9
|
def test_word_beginning_with_a(self):
|
10
10
|
self.assertEqual(translate("apple"), "appleay")
|
11
11
|
|
@@ -5,7 +5,7 @@ from protein_translation import proteins
|
|
5
5
|
|
6
6
|
# Tests adapted from problem-specifications/canonical-data.json @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class ProteinTranslationTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_AUG_translates_to_methionine(self):
|
11
11
|
self.assertEqual(proteins('AUG'), ['Methionine'])
|
@@ -5,7 +5,7 @@ from rail_fence_cipher import encode, decode
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class RailFenceCipherTest(unittest.TestCase):
|
9
9
|
def test_encode_with_two_rails(self):
|
10
10
|
self.assertMultiLineEqual(
|
11
11
|
encode('XOXOXOXOXOXOXOXOXO', 2), 'XXXXXXXXXOOOOOOOOO')
|
@@ -7,7 +7,7 @@ from rational_numbers import Rational
|
|
7
7
|
|
8
8
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
|
9
9
|
|
10
|
-
class
|
10
|
+
class RationalNumbersTest(unittest.TestCase):
|
11
11
|
|
12
12
|
# Test addition
|
13
13
|
def test_add_two_positive(self):
|
@@ -6,7 +6,7 @@ from react import InputCell, ComputeCell
|
|
6
6
|
|
7
7
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.0
|
8
8
|
|
9
|
-
class
|
9
|
+
class ReactTest(unittest.TestCase):
|
10
10
|
|
11
11
|
def test_input_cells_have_a_value(self):
|
12
12
|
input_ = InputCell(10)
|
@@ -5,7 +5,7 @@ from reverse_string import reverse
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class ReverseStringTest(unittest.TestCase):
|
9
9
|
def test_empty_string(self):
|
10
10
|
self.assertEqual(reverse(''), '')
|
11
11
|
|
@@ -5,7 +5,7 @@ from rna_transcription import to_rna
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class RnaTranscriptionTest(unittest.TestCase):
|
9
9
|
|
10
10
|
def test_transcribes_cytosine_to_guanine(self):
|
11
11
|
self.assertEqual(to_rna('C'), 'G')
|
@@ -4,7 +4,7 @@ import random
|
|
4
4
|
from robot_name import Robot
|
5
5
|
|
6
6
|
|
7
|
-
class
|
7
|
+
class RobotNameTest(unittest.TestCase):
|
8
8
|
# assertRegex() alias to adress DeprecationWarning
|
9
9
|
# assertRegexpMatches got renamed in version 3.2
|
10
10
|
if not hasattr(unittest.TestCase, "assertRegex"):
|
@@ -5,7 +5,7 @@ from robot_simulator import Robot, NORTH, EAST, SOUTH, WEST
|
|
5
5
|
|
6
6
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.2.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class RobotSimulatorTest(unittest.TestCase):
|
9
9
|
def test_init(self):
|
10
10
|
robot = Robot()
|
11
11
|
self.assertEqual(robot.coordinates, (0, 0))
|