trackler 2.2.1.172 → 2.2.1.173
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/docs/ABOUT.md +2 -0
- data/tracks/ballerina/docs/INSTALLATION.md +1 -0
- data/tracks/ballerina/docs/LEARNING.md +1 -0
- data/tracks/ballerina/docs/TESTS.md +132 -0
- data/tracks/common-lisp/README.md +2 -2
- data/tracks/common-lisp/docs/SNIPPET.txt +4 -8
- data/tracks/factor/config.json +1 -0
- data/tracks/haskell/config.json +2 -1
- data/tracks/nim/exercises/allergies/allergies_test.nim +20 -21
- data/tracks/nim/exercises/anagram/anagram_test.nim +65 -63
- data/tracks/nim/exercises/binary/binary_test.nim +37 -36
- data/tracks/nim/exercises/bob/bob_test.nim +1 -1
- data/tracks/nim/exercises/bracket-push/bracket_push_test.nim +1 -1
- data/tracks/nim/exercises/difference-of-squares/difference_of_squares_test.nim +14 -12
- data/tracks/nim/exercises/gigasecond/example.nim +1 -1
- data/tracks/nim/exercises/gigasecond/gigasecond_test.nim +24 -24
- data/tracks/nim/exercises/hamming/hamming_test.nim +16 -14
- data/tracks/nim/exercises/hello-world/helloworld_test.nim +8 -6
- data/tracks/nim/exercises/leap/example.nim +1 -1
- data/tracks/nim/exercises/nucleotide-count/nucleotide_count_test.nim +19 -17
- data/tracks/nim/exercises/pangram/example.nim +3 -3
- data/tracks/nim/exercises/pangram/pangram_test.nim +11 -10
- data/tracks/nim/exercises/raindrops/raindrops_test.nim +35 -33
- data/tracks/nim/exercises/rna-transcription/rna_transcription_test.nim +15 -13
- data/tracks/nim/exercises/roman-numerals/example.nim +24 -25
- data/tracks/nim/exercises/roman-numerals/roman_numerals_test.nim +62 -28
- data/tracks/nim/exercises/scrabble-score/example.nim +6 -4
- data/tracks/nim/exercises/scrabble-score/scrabble_score_test.nim +13 -12
- data/tracks/nim/exercises/triangle/example.nim +15 -15
- data/tracks/nim/exercises/triangle/triangle_test.nim +14 -14
- data/tracks/python/exercises/simple-cipher/simple_cipher_test.py +3 -2
- metadata +2 -2
@@ -2,23 +2,25 @@ import unittest
|
|
2
2
|
|
3
3
|
import hamming
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
suite "Hamming":
|
6
|
+
|
7
|
+
test "no difference between identical strands":
|
8
|
+
check distance("A", "A") == 0
|
7
9
|
|
8
|
-
test "complate Hamming distance for single nucleotide strand":
|
9
|
-
|
10
|
+
test "complate Hamming distance for single nucleotide strand":
|
11
|
+
check distance("A", "G") == 1
|
10
12
|
|
11
|
-
test "complete Hamming distance for small strand":
|
12
|
-
|
13
|
+
test "complete Hamming distance for small strand":
|
14
|
+
check distance("AG", "CT") == 2
|
13
15
|
|
14
|
-
test "small Hamming distance":
|
15
|
-
|
16
|
+
test "small Hamming distance":
|
17
|
+
check distance("AT", "CT") == 1
|
16
18
|
|
17
|
-
test "small Hamming distance in longer strand":
|
18
|
-
|
19
|
+
test "small Hamming distance in longer strand":
|
20
|
+
check distance("GGACG", "GGTCG") == 1
|
19
21
|
|
20
|
-
test "large Hamming distance":
|
21
|
-
|
22
|
+
test "large Hamming distance":
|
23
|
+
check distance("GATACA", "GCATAA") == 4
|
22
24
|
|
23
|
-
test "Hamming distance in a very large strand":
|
24
|
-
|
25
|
+
test "Hamming distance in a very large strand":
|
26
|
+
check distance("GGACGGATTCTG", "AGGACGGATTCT") == 9
|
@@ -2,11 +2,13 @@ import unittest
|
|
2
2
|
|
3
3
|
import helloworld
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
suite "Hello World":
|
6
|
+
|
7
|
+
test "no name":
|
8
|
+
check helloworld() == "Hello, World!"
|
7
9
|
|
8
|
-
test "sample name":
|
9
|
-
|
10
|
+
test "sample name":
|
11
|
+
check helloworld("Alice") == "Hello, Alice!"
|
10
12
|
|
11
|
-
test "other sample name":
|
12
|
-
|
13
|
+
test "other sample name":
|
14
|
+
check helloworld("Bob") == "Hello, Bob!"
|
@@ -2,25 +2,27 @@ import tables
|
|
2
2
|
import unittest
|
3
3
|
import nucleotide_count
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
suite "Nucleotide":
|
6
|
+
|
7
|
+
test "count empty string":
|
8
|
+
check count('A', "") == 0
|
7
9
|
|
8
|
-
test "count repetitive cytosine":
|
9
|
-
|
10
|
+
test "count repetitive cytosine":
|
11
|
+
check count('C', "CCCCC") == 5
|
10
12
|
|
11
|
-
test "count only thymine":
|
12
|
-
|
13
|
+
test "count only thymine":
|
14
|
+
check count('T', "GGGGGTAACCCGG") == 1
|
13
15
|
|
14
|
-
test "countDna empty":
|
15
|
-
|
16
|
+
test "countDna empty":
|
17
|
+
check len(countDna("")) == 0
|
16
18
|
|
17
|
-
test "countDna only guanine":
|
18
|
-
|
19
|
-
|
19
|
+
test "countDna only guanine":
|
20
|
+
let counts = countDna("GGGGGGGG")
|
21
|
+
check counts['G'] == 8
|
20
22
|
|
21
|
-
test "countDna counts all":
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
test "countDna counts all":
|
24
|
+
let counts = countDna("AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")
|
25
|
+
check counts['A'] == 20
|
26
|
+
check counts['C'] == 12
|
27
|
+
check counts['T'] == 21
|
28
|
+
check counts['G'] == 17
|
@@ -2,34 +2,35 @@ import unittest
|
|
2
2
|
|
3
3
|
from pangram import isPangram
|
4
4
|
|
5
|
+
suite "Pangram":
|
5
6
|
|
6
|
-
test "sentence empty":
|
7
|
+
test "sentence empty":
|
7
8
|
check isPangram("") == false
|
8
9
|
|
9
|
-
test "recognizes a perfect lower case pangram":
|
10
|
+
test "recognizes a perfect lower case pangram":
|
10
11
|
check isPangram("abcdefghijklmnopqrstuvwxyz") == true
|
11
12
|
|
12
|
-
test "test pangram with only lower case":
|
13
|
+
test "test pangram with only lower case":
|
13
14
|
check isPangram("the quick brown fox jumps over the lazy dog") == true
|
14
15
|
|
15
|
-
test "missing character x":
|
16
|
+
test "missing character x":
|
16
17
|
check isPangram("a quick movement of the enemy will jeopardize five gunboats") == false
|
17
18
|
|
18
|
-
test "another missing character":
|
19
|
+
test "another missing character":
|
19
20
|
check isPangram("five boxing wizards jump quickly at it") == false
|
20
21
|
|
21
|
-
test "pangram with underscores":
|
22
|
+
test "pangram with underscores":
|
22
23
|
check isPangram("the_quick_brown_fox_jumps_over_the_lazy_dog") == true
|
23
24
|
|
24
|
-
test "pangram with numbers":
|
25
|
+
test "pangram with numbers":
|
25
26
|
check isPangram("the 1 quick brown fox jumps over the 2 lazy dogs") == true
|
26
27
|
|
27
|
-
test "missing letters replaced by numbers":
|
28
|
+
test "missing letters replaced by numbers":
|
28
29
|
check isPangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog") == false
|
29
30
|
|
30
|
-
test "pangram with mixedcase and punctuation":
|
31
|
+
test "pangram with mixedcase and punctuation":
|
31
32
|
check isPangram("Five quacking Zephyrs jolt my wax bed.") == true
|
32
33
|
|
33
|
-
test "upper and lower case versions of the same character":
|
34
|
+
test "upper and lower case versions of the same character":
|
34
35
|
check isPangram("the quick brown fox jumped over the lazy FX") == false
|
35
36
|
|
@@ -1,51 +1,53 @@
|
|
1
|
-
import tables
|
2
1
|
import unittest
|
2
|
+
|
3
3
|
import raindrops
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
suite "Raindrops":
|
6
|
+
|
7
|
+
test "convert 1":
|
8
|
+
check convert(1) == "1"
|
7
9
|
|
8
|
-
test "convert 3":
|
9
|
-
|
10
|
+
test "convert 3":
|
11
|
+
check convert(3) == "Pling"
|
10
12
|
|
11
|
-
test "convert 5":
|
12
|
-
|
13
|
+
test "convert 5":
|
14
|
+
check convert(5) == "Plang"
|
13
15
|
|
14
|
-
test "convert 7":
|
15
|
-
|
16
|
+
test "convert 7":
|
17
|
+
check convert(7) == "Plong"
|
16
18
|
|
17
|
-
test "convert 6":
|
18
|
-
|
19
|
+
test "convert 6":
|
20
|
+
check convert(6) == "Pling"
|
19
21
|
|
20
|
-
test "convert 9":
|
21
|
-
|
22
|
+
test "convert 9":
|
23
|
+
check convert(9) == "Pling"
|
22
24
|
|
23
|
-
test "convert 10":
|
24
|
-
|
25
|
+
test "convert 10":
|
26
|
+
check convert(10) == "Plang"
|
25
27
|
|
26
|
-
test "convert 14":
|
27
|
-
|
28
|
+
test "convert 14":
|
29
|
+
check convert(14) == "Plong"
|
28
30
|
|
29
|
-
test "convert 15":
|
30
|
-
|
31
|
+
test "convert 15":
|
32
|
+
check convert(15) == "PlingPlang"
|
31
33
|
|
32
|
-
test "convert 21":
|
33
|
-
|
34
|
+
test "convert 21":
|
35
|
+
check convert(21) == "PlingPlong"
|
34
36
|
|
35
|
-
test "convert 25":
|
36
|
-
|
37
|
+
test "convert 25":
|
38
|
+
check convert(25) == "Plang"
|
37
39
|
|
38
|
-
test "convert 35":
|
39
|
-
|
40
|
+
test "convert 35":
|
41
|
+
check convert(35) == "PlangPlong"
|
40
42
|
|
41
|
-
test "convert 49":
|
42
|
-
|
43
|
+
test "convert 49":
|
44
|
+
check convert(49) == "Plong"
|
43
45
|
|
44
|
-
test "convert 52":
|
45
|
-
|
46
|
+
test "convert 52":
|
47
|
+
check convert(52) == "52"
|
46
48
|
|
47
|
-
test "convert 105":
|
48
|
-
|
49
|
+
test "convert 105":
|
50
|
+
check convert(105) == "PlingPlangPlong"
|
49
51
|
|
50
|
-
test "convert 12121":
|
51
|
-
|
52
|
+
test "convert 12121":
|
53
|
+
check convert(12121) == "12121"
|
@@ -2,21 +2,23 @@ import unittest
|
|
2
2
|
|
3
3
|
import rna_transcription
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
suite "RNA Transcription":
|
6
|
+
|
7
|
+
test "transcribes G to C":
|
8
|
+
check toRna("G") == "C"
|
7
9
|
|
8
|
-
test "transcribes C to G":
|
9
|
-
|
10
|
+
test "transcribes C to G":
|
11
|
+
check toRna("C") == "G"
|
10
12
|
|
11
|
-
test "transcribes T to A":
|
12
|
-
|
13
|
+
test "transcribes T to A":
|
14
|
+
check toRna("T") == "A"
|
13
15
|
|
14
|
-
test "transcribes A to U":
|
15
|
-
|
16
|
+
test "transcribes A to U":
|
17
|
+
check toRna("A") == "U"
|
16
18
|
|
17
|
-
test "transcribe all occurrences":
|
18
|
-
|
19
|
+
test "transcribe all occurrences":
|
20
|
+
check toRna("ACGTGGTCTTAA") == "UGCACCAGAAUU"
|
19
21
|
|
20
|
-
test "raise ValueError on invalid nucleotide":
|
21
|
-
|
22
|
-
|
22
|
+
test "raise ValueError on invalid nucleotide":
|
23
|
+
expect(ValueError):
|
24
|
+
discard toRna("Q")
|
@@ -1,30 +1,29 @@
|
|
1
1
|
type
|
2
|
-
|
3
|
-
|
2
|
+
Numeral = tuple[number: int, roman: string]
|
3
|
+
NumeralArray = array[13, Numeral]
|
4
4
|
|
5
5
|
let
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
6
|
+
numeral_mapping: NumeralArray = [
|
7
|
+
(1000, "M"),
|
8
|
+
(900, "CM"),
|
9
|
+
(500, "D"),
|
10
|
+
(400, "CD"),
|
11
|
+
(100, "C"),
|
12
|
+
(90, "XC"),
|
13
|
+
(50, "L"),
|
14
|
+
(40, "XL"),
|
15
|
+
(10, "X"),
|
16
|
+
(9, "IX"),
|
17
|
+
(5, "V"),
|
18
|
+
(4, "IV"),
|
19
|
+
(1, "I")
|
20
|
+
]
|
21
21
|
|
22
22
|
|
23
|
-
proc
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
return s
|
23
|
+
proc roman*(number: int): string =
|
24
|
+
result = ""
|
25
|
+
var n = number
|
26
|
+
for numeral in numeral_mapping:
|
27
|
+
while n >= numeral.number:
|
28
|
+
result = result & numeral.roman
|
29
|
+
n = n - numeral.number
|
@@ -1,28 +1,62 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
1
|
+
import unittest
|
2
|
+
|
3
|
+
import roman_numerals
|
4
|
+
|
5
|
+
suite "Roman Numerals":
|
6
|
+
|
7
|
+
test "1 is a single I":
|
8
|
+
check roman(1) == "I"
|
9
|
+
|
10
|
+
test "2 is two I's":
|
11
|
+
check roman(2) == "II"
|
12
|
+
|
13
|
+
test "3 is three I's":
|
14
|
+
check roman(3) == "III"
|
15
|
+
|
16
|
+
test "4, being 5 - 1, is IV":
|
17
|
+
check roman(4) == "IV"
|
18
|
+
|
19
|
+
test "5 is a single V":
|
20
|
+
check roman(5) == "V"
|
21
|
+
|
22
|
+
test "6, being 5 + 1, is VI":
|
23
|
+
check roman(6) == "VI"
|
24
|
+
|
25
|
+
test "9, being 10 - 1, is IX":
|
26
|
+
check roman(9) == "IX"
|
27
|
+
|
28
|
+
test "20 is two X's":
|
29
|
+
check roman(27) == "XXVII"
|
30
|
+
|
31
|
+
test "48 is not 50 - 2 but rather 40 + 8":
|
32
|
+
check roman(48) == "XLVIII"
|
33
|
+
|
34
|
+
test "49 is not 40 + 5 + 4 but rather 50 - 10 + 10 - 1":
|
35
|
+
check roman(49) == "XLIX"
|
36
|
+
|
37
|
+
test "50 is a single L":
|
38
|
+
check roman(59) == "LIX"
|
39
|
+
|
40
|
+
test "90, being 100 - 10, is XC":
|
41
|
+
check roman(93) == "XCIII"
|
42
|
+
|
43
|
+
test "100 is a single C":
|
44
|
+
check roman(141) == "CXLI"
|
45
|
+
|
46
|
+
test "60, being 50 + 10, is LX":
|
47
|
+
check roman(163) == "CLXIII"
|
48
|
+
|
49
|
+
test "400, being 500 - 100, is CD":
|
50
|
+
check roman(402) == "CDII"
|
51
|
+
|
52
|
+
test "500 is a single D":
|
53
|
+
check roman(575) == "DLXXV"
|
54
|
+
|
55
|
+
test "900, being 1000 - 100, is CM":
|
56
|
+
check roman(911) == "CMXI"
|
57
|
+
|
58
|
+
test "1000 is a single M":
|
59
|
+
check roman(1024) == "MXXIV"
|
60
|
+
|
61
|
+
test "3000 is three M's":
|
62
|
+
check roman(3000) == "MMM"
|
@@ -1,13 +1,15 @@
|
|
1
|
-
import
|
1
|
+
import
|
2
|
+
tables, sequtils, strutils, math
|
2
3
|
|
3
|
-
let
|
4
|
+
let
|
5
|
+
points = {
|
4
6
|
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1,
|
5
7
|
'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8,
|
6
8
|
'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1,
|
7
9
|
'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1,
|
8
10
|
'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4,
|
9
11
|
'z': 10
|
10
|
-
}.toTable
|
12
|
+
}.toTable
|
11
13
|
|
12
14
|
proc score*(word: string): int =
|
13
|
-
|
15
|
+
word.toLowerAscii.mapIt(points[it]).sum
|
@@ -2,36 +2,37 @@ import unittest
|
|
2
2
|
|
3
3
|
from scrabble_score import score
|
4
4
|
|
5
|
+
suite "Scrabble Score":
|
5
6
|
|
6
|
-
test "lowercase letter":
|
7
|
+
test "lowercase letter":
|
7
8
|
check score("a") == 1
|
8
9
|
|
9
|
-
test "uppercase letter":
|
10
|
+
test "uppercase letter":
|
10
11
|
check score("A") == 1
|
11
12
|
|
12
|
-
test "valuable letter":
|
13
|
+
test "valuable letter":
|
13
14
|
check score("f") == 4
|
14
15
|
|
15
|
-
test "short word":
|
16
|
+
test "short word":
|
16
17
|
check score("at") == 2
|
17
18
|
|
18
|
-
test "short valuable word":
|
19
|
+
test "short valuable word":
|
19
20
|
check score("zoo") == 12
|
20
21
|
|
21
|
-
test "medium word":
|
22
|
+
test "medium word":
|
22
23
|
check score("street") == 6
|
23
24
|
|
24
|
-
test "medium valuable word":
|
25
|
+
test "medium valuable word":
|
25
26
|
check score("quirky") == 22
|
26
27
|
|
27
|
-
test "long mixed case word":
|
28
|
+
test "long mixed case word":
|
28
29
|
check score("OxyphenButazone") == 41
|
29
30
|
|
30
|
-
test "english like word":
|
31
|
+
test "english like word":
|
31
32
|
check score("pinata") == 8
|
32
33
|
|
33
|
-
test "empty input":
|
34
|
+
test "empty input":
|
34
35
|
check score("") == 0
|
35
36
|
|
36
|
-
test "entire alphabet available":
|
37
|
-
check score("abcdefghijklmnopqrstuvwxyz") == 87
|
37
|
+
test "entire alphabet available":
|
38
|
+
check score("abcdefghijklmnopqrstuvwxyz") == 87
|
@@ -1,25 +1,25 @@
|
|
1
1
|
import sequtils
|
2
2
|
|
3
3
|
proc valid(a, b, c: int): bool =
|
4
|
-
|
5
|
-
|
4
|
+
let greatThenZero = all([a, b, c], proc (x: int): bool = return x > 0)
|
5
|
+
let equalityCheck = (a + b >= c) and (a + c >= b) and (b + c >= a)
|
6
6
|
|
7
|
-
|
7
|
+
greatThenZero and equalityCheck
|
8
8
|
|
9
9
|
proc isEquilateral*(sides: array[3, int]): bool =
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
let a = sides[0]
|
11
|
+
let b = sides[1]
|
12
|
+
let c = sides[2]
|
13
|
+
valid(a, b, c) and all(sides, proc (x: int): bool = return a == x)
|
14
14
|
|
15
15
|
proc isIsosceles*(sides: array[3, int]): bool =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
let a = sides[0]
|
17
|
+
let b = sides[1]
|
18
|
+
let c = sides[2]
|
19
|
+
valid(a, b, c) and (a == b or b == c or a == c)
|
20
20
|
|
21
21
|
proc isScalene*(sides: array[3, int]): bool =
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
let a = sides[0]
|
23
|
+
let b = sides[1]
|
24
|
+
let c = sides[2]
|
25
|
+
valid(a, b, c) and not isIsosceles(sides)
|
@@ -5,49 +5,49 @@ import triangle
|
|
5
5
|
suite "returns true if the triangle is equilateral":
|
6
6
|
|
7
7
|
test "true if all sides are equal":
|
8
|
-
|
8
|
+
check isEquilateral([2, 2, 2]) == true
|
9
9
|
|
10
10
|
test "false if any side is unequal":
|
11
|
-
|
11
|
+
check isEquilateral([2, 3, 2]) == false
|
12
12
|
|
13
13
|
test "false if no sides are equal":
|
14
|
-
|
14
|
+
check isEquilateral([5, 4, 6]) == false
|
15
15
|
|
16
16
|
test "false if all sides are zero":
|
17
|
-
|
17
|
+
check isEquilateral([0, 0, 0]) == false
|
18
18
|
|
19
19
|
|
20
20
|
suite "returns true if the triangle is isosceles":
|
21
21
|
|
22
22
|
test "true if last two sides are equal":
|
23
|
-
|
23
|
+
check isIsosceles([3, 4, 4]) == true
|
24
24
|
|
25
25
|
test "true if first two sides are equal":
|
26
|
-
|
26
|
+
check isIsosceles([4, 4, 3]) == true
|
27
27
|
|
28
28
|
test "true if first and last sides are equal":
|
29
|
-
|
29
|
+
check isIsosceles([4, 3, 4]) == true
|
30
30
|
|
31
31
|
test "is equilateral triangles are also is isosceles":
|
32
|
-
|
32
|
+
check isIsosceles([4, 4, 4]) == true
|
33
33
|
|
34
34
|
test "false if no sides are equal":
|
35
|
-
|
35
|
+
check isIsosceles([2, 3, 4]) == false
|
36
36
|
|
37
37
|
test "violation of triangle inequality not is isosceles":
|
38
|
-
|
38
|
+
check isIsosceles([1, 1, 3]) == false
|
39
39
|
|
40
40
|
|
41
41
|
suite "returns true if the triangle is scalene":
|
42
42
|
|
43
43
|
test "true if no sides are equal":
|
44
|
-
|
44
|
+
check isScalene([5, 4, 6]) == true
|
45
45
|
|
46
46
|
test "false if all sides are equal":
|
47
|
-
|
47
|
+
check isScalene([4, 4, 4]) == false
|
48
48
|
|
49
49
|
test "false if two sides are equal":
|
50
|
-
|
50
|
+
check isScalene([4, 4, 3]) == false
|
51
51
|
|
52
52
|
test "violation of triangle inequality not is scalene":
|
53
|
-
|
53
|
+
check isScalene([7, 3, 2]) == false
|
@@ -4,7 +4,7 @@ import re
|
|
4
4
|
from simple_cipher import Cipher
|
5
5
|
|
6
6
|
|
7
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
7
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
8
8
|
|
9
9
|
class SimpleCipherTest(unittest.TestCase):
|
10
10
|
# Utility functions
|
@@ -21,7 +21,8 @@ class SimpleCipherTest(unittest.TestCase):
|
|
21
21
|
class RandomKeyCipherTest(SimpleCipherTest):
|
22
22
|
def test_can_encode(self):
|
23
23
|
cipher = Cipher()
|
24
|
-
|
24
|
+
plaintext = 'aaaaaaaaaa'
|
25
|
+
self.assertEqual(cipher.encode(plaintext), cipher.key[:len(plaintext)])
|
25
26
|
|
26
27
|
def test_can_decode(self):
|
27
28
|
cipher = Cipher()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.173
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|