trackler 2.2.1.15 → 2.2.1.16
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/TOPICS.txt +8 -1
- data/tracks/c/docs/SNIPPET.txt +11 -0
- data/tracks/ceylon/docs/SNIPPET.txt +3 -0
- data/tracks/clojure/docs/SNIPPET.txt +5 -0
- data/tracks/csharp/build.cake +23 -16
- data/tracks/csharp/build.ps1 +1 -1
- data/tracks/csharp/build.sh +1 -1
- data/tracks/csharp/exercises/pangram/PangramTest.cs +9 -18
- data/tracks/csharp/generators/.gitignore +2 -1
- data/tracks/csharp/generators/Exercise.cs +11 -12
- data/tracks/csharp/generators/Exercises/AllYourBase.cs +2 -2
- data/tracks/csharp/generators/Exercises/Allergies.cs +1 -1
- data/tracks/csharp/generators/Exercises/Alphametics.cs +1 -1
- data/tracks/csharp/generators/Exercises/Anagram.cs +1 -1
- data/tracks/csharp/generators/Exercises/BeerSong.cs +1 -1
- data/tracks/csharp/generators/Exercises/BinarySearch.cs +1 -1
- data/tracks/csharp/generators/Exercises/BookStore.cs +1 -1
- data/tracks/csharp/generators/Exercises/BracketPush.cs +1 -1
- data/tracks/csharp/generators/Exercises/CollatzConjecture.cs +2 -2
- data/tracks/csharp/generators/Exercises/CryptoSquare.cs +1 -1
- data/tracks/csharp/generators/Exercises/FoodChain.cs +1 -1
- data/tracks/csharp/generators/Exercises/Gigasecond.cs +1 -1
- data/tracks/csharp/generators/Exercises/Hamming.cs +1 -1
- data/tracks/csharp/generators/Exercises/House.cs +1 -1
- data/tracks/csharp/generators/Exercises/Leap.cs +1 -1
- data/tracks/csharp/generators/Exercises/Luhn.cs +1 -1
- data/tracks/csharp/generators/Exercises/NthPrime.cs +1 -1
- data/tracks/csharp/generators/Exercises/Pangram.cs +1 -11
- data/tracks/csharp/generators/Exercises/PerfectNumbers.cs +1 -1
- data/tracks/csharp/generators/Exercises/PhoneNumber.cs +1 -1
- data/tracks/csharp/generators/Exercises/RailFenceCipher.cs +1 -1
- data/tracks/csharp/generators/Exercises/RnaTranscription.cs +1 -1
- data/tracks/csharp/generators/Exercises/RomanNumerals.cs +1 -1
- data/tracks/csharp/generators/Exercises/RunLengthEncoding.cs +1 -1
- data/tracks/csharp/generators/Exercises/Say.cs +2 -7
- data/tracks/csharp/generators/Exercises/SecretHandshake.cs +1 -1
- data/tracks/csharp/generators/Exercises/Sieve.cs +1 -1
- data/tracks/csharp/generators/Exercises/SpaceAge.cs +1 -1
- data/tracks/csharp/generators/Exercises/SumOfMultiples.cs +1 -1
- data/tracks/csharp/generators/Exercises/Transpose.cs +1 -1
- data/tracks/csharp/generators/Exercises/WordCount.cs +1 -1
- data/tracks/csharp/generators/Exercises/Wordy.cs +1 -1
- data/tracks/csharp/generators/Output/FormattingExtensions.cs +4 -2
- data/tracks/csharp/generators/Output/ValueFormatter.cs +1 -1
- data/tracks/delphi/docs/SNIPPET.txt +6 -13
- data/tracks/ecmascript/docs/SNIPPET.txt +7 -0
- data/tracks/elisp/docs/SNIPPET.txt +13 -0
- data/tracks/elixir/config.json +2 -2
- data/tracks/elixir/docs/SNIPPET.txt +10 -0
- data/tracks/erlang/docs/SNIPPET.txt +8 -0
- data/tracks/fsharp/docs/SNIPPET.txt +3 -0
- data/tracks/go/config.json +174 -174
- data/tracks/go/config/maintainers.json +6 -9
- data/tracks/go/docs/SNIPPET.txt +6 -0
- data/tracks/groovy/config.json +4 -4
- data/tracks/groovy/docs/SNIPPET.txt +12 -0
- data/tracks/haskell/config.json +2 -0
- data/tracks/haskell/docs/SNIPPET.txt +4 -0
- data/tracks/java/docs/SNIPPET.txt +7 -0
- data/tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java +21 -16
- data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +24 -24
- data/tracks/javascript/docs/SNIPPET.txt +10 -0
- data/tracks/kotlin/docs/SNIPPET.txt +3 -0
- data/tracks/kotlin/exercises/change/src/example/kotlin/ChangeCalculator.kt +35 -0
- data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeCalculatorTest.kt +105 -0
- data/tracks/lfe/docs/SNIPPET.txt +12 -0
- data/tracks/lua/docs/SNIPPET.txt +7 -0
- data/tracks/mips/docs/SNIPPET.txt +23 -0
- data/tracks/ocaml/docs/SNIPPET.txt +1 -0
- data/tracks/purescript/config.json +1 -1
- data/tracks/purescript/docs/SNIPPET.txt +8 -0
- data/tracks/python/exercises/saddle-points/README.md +1 -1
- data/tracks/racket/docs/SNIPPET.txt +6 -0
- data/tracks/ruby/docs/SNIPPET.txt +5 -0
- data/tracks/rust/docs/SNIPPET.txt +3 -0
- data/tracks/scala/docs/SNIPPET.txt +4 -0
- data/tracks/scala/exercises/ocr-numbers/example.scala +17 -11
- data/tracks/scala/exercises/ocr-numbers/src/test/scala/OcrNumbersTest.scala +153 -0
- data/tracks/scala/exercises/pig-latin/example.scala +11 -6
- data/tracks/scala/exercises/pig-latin/src/test/scala/PigLatinTest.scala +80 -10
- data/tracks/scala/testgen/src/main/scala/OcrNumbersTestGenerator.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/PigLatinTestGenerator.scala +16 -0
- data/tracks/scheme/docs/SNIPPET.txt +7 -0
- data/tracks/sml/bin/generate +277 -0
- data/tracks/sml/config.json +30 -0
- data/tracks/sml/docs/ABOUT.md +32 -0
- data/tracks/sml/docs/LEARNING.md +37 -0
- data/tracks/sml/docs/SNIPPET.txt +3 -0
- data/tracks/sml/exercises/bob/README.md +48 -0
- data/tracks/sml/exercises/bob/bob.sml +2 -0
- data/tracks/sml/exercises/bob/example.sml +22 -0
- data/tracks/sml/exercises/bob/test.sml +87 -0
- data/tracks/sml/exercises/bob/testlib.sml +159 -0
- data/tracks/sml/exercises/difference-of-squares/README.md +49 -0
- data/tracks/sml/exercises/difference-of-squares/difference-of-squares.sml +8 -0
- data/tracks/sml/exercises/difference-of-squares/example.sml +11 -0
- data/tracks/sml/exercises/difference-of-squares/test.sml +45 -0
- data/tracks/sml/exercises/difference-of-squares/testlib.sml +159 -0
- data/tracks/sml/exercises/hello-world/README.md +51 -0
- data/tracks/sml/exercises/hello-world/example.sml +1 -0
- data/tracks/sml/exercises/hello-world/hello-world.sml +2 -0
- data/tracks/sml/exercises/hello-world/test.sml +15 -0
- data/tracks/sml/exercises/hello-world/testlib.sml +159 -0
- data/tracks/sml/lib/testlib.sml +159 -0
- data/tracks/swift/docs/SNIPPET.txt +9 -0
- data/tracks/typescript/docs/SNIPPET.txt +8 -0
- metadata +53 -6
- data/tracks/csharp/generators/Generators.csproj.user +0 -6
- data/tracks/kotlin/exercises/change/src/example/kotlin/Change.kt +0 -70
- data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeTest.kt +0 -55
- data/tracks/scala/exercises/ocr-numbers/src/test/scala/OcrTest.scala +0 -138
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c97fcf2d7f6d2185c61b30676dc864888a9b50
|
4
|
+
data.tar.gz: 0eeef9cbaed6ef79a64e119d2e2a6c04785bb6c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668da44c9adb98cd58873dee0948cb9f7c8a7f891169d56f3b2b6b7dded8a5905645ec7b59941254d1dfc2e221fb92fe19dbf4985977bf6b2bdf2e2d603fc3c1
|
7
|
+
data.tar.gz: 3a7468c948c4e9ea3823b3e9186ebcd7c7b9fa87c3650a828fa535ec0a0018c8a8254c9356150f59cb3da6c14718698a04772df47a8686b667a6d0c9e43d559e
|
data/lib/trackler/version.rb
CHANGED
@@ -63,7 +63,6 @@ Parsing
|
|
63
63
|
Pattern recognition
|
64
64
|
Performance
|
65
65
|
Randomness
|
66
|
-
Reactive programming
|
67
66
|
Refactoring
|
68
67
|
Regular Expressions
|
69
68
|
Searching
|
@@ -71,3 +70,11 @@ Security
|
|
71
70
|
Sorting
|
72
71
|
Text formatting
|
73
72
|
Transforming
|
73
|
+
|
74
|
+
Programming Style
|
75
|
+
---
|
76
|
+
Behavior-driven development
|
77
|
+
Functional programming
|
78
|
+
Object-oriented programming
|
79
|
+
Reactive programming
|
80
|
+
Test-driven development
|
data/tracks/csharp/build.cake
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
using System.IO;
|
2
2
|
using System.Text.RegularExpressions;
|
3
|
+
using System.Threading.Tasks;
|
3
4
|
|
4
5
|
var target = Argument("target", "Default");
|
5
6
|
|
6
7
|
var sourceDir = "./exercises";
|
7
8
|
var buildDir = "./build";
|
8
9
|
|
9
|
-
var defaultSln = buildDir + "/Exercises.Default.sln";
|
10
10
|
var allSln = buildDir + "/Exercises.All.sln";
|
11
11
|
var refactoringSln = buildDir + "/Exercises.Refactoring.sln";
|
12
12
|
|
13
|
-
var
|
13
|
+
var dotNetCoreMSBuildSettings = new DotNetCoreMSBuildSettings
|
14
|
+
{
|
15
|
+
MaxCpuCount = 0
|
16
|
+
};
|
17
|
+
|
18
|
+
var dotNetCoreBuildSettings = new DotNetCoreBuildSettings
|
19
|
+
{
|
20
|
+
NoIncremental = true,
|
21
|
+
MSBuildSettings = dotNetCoreMSBuildSettings
|
22
|
+
};
|
23
|
+
|
24
|
+
var dotNetCoreTestSettings = new DotNetCoreTestSettings
|
25
|
+
{
|
26
|
+
NoBuild = true
|
27
|
+
};
|
14
28
|
|
15
29
|
Task("Clean")
|
16
30
|
.Does(() => {
|
@@ -30,14 +44,8 @@ Task("RestoreNugetPackages")
|
|
30
44
|
DotNetCoreRestore(allSln);
|
31
45
|
});
|
32
46
|
|
33
|
-
Task("BuildStubImplementations")
|
34
|
-
.IsDependentOn("RestoreNugetPackages")
|
35
|
-
.Does(() => {
|
36
|
-
DotNetCoreBuild(defaultSln, dotNetCoreBuildSettings);
|
37
|
-
});
|
38
|
-
|
39
47
|
Task("EnableAllTests")
|
40
|
-
.IsDependentOn("
|
48
|
+
.IsDependentOn("RestoreNugetPackages")
|
41
49
|
.Does(() => {
|
42
50
|
var skipRegex = new Regex(@"Skip\s*=\s*""Remove to run test""", RegexOptions.Compiled);
|
43
51
|
var testFiles = GetFiles(buildDir + "/*/*Test.cs");
|
@@ -64,9 +72,7 @@ Task("TestRefactoringProjects")
|
|
64
72
|
+ GetFiles(buildDir + "/*/Ledger.csproj")
|
65
73
|
+ GetFiles(buildDir + "/*/Markdown.csproj");
|
66
74
|
|
67
|
-
|
68
|
-
DotNetCoreTest(refactoringProject.FullPath);
|
69
|
-
}
|
75
|
+
Parallel.ForEach(refactoringProjects, (project) => DotNetCoreTest(project.FullPath, dotNetCoreTestSettings));
|
70
76
|
});
|
71
77
|
|
72
78
|
Task("ReplaceStubWithExample")
|
@@ -89,12 +95,13 @@ Task("TestUsingExampleImplementation")
|
|
89
95
|
.IsDependentOn("ReplaceStubWithExample")
|
90
96
|
.Does(() => {
|
91
97
|
DotNetCoreBuild(allSln, dotNetCoreBuildSettings);
|
98
|
+
var parallelOptions = new ParallelOptions
|
99
|
+
{
|
100
|
+
MaxDegreeOfParallelism = System.Environment.ProcessorCount
|
101
|
+
};
|
92
102
|
|
93
103
|
var allProjects = GetFiles(buildDir + "/*/*.csproj");
|
94
|
-
|
95
|
-
foreach (var project in allProjects) {
|
96
|
-
DotNetCoreTest(project.FullPath);
|
97
|
-
}
|
104
|
+
Parallel.ForEach(allProjects, parallelOptions, (project) => DotNetCoreTest(project.FullPath, dotNetCoreTestSettings));
|
98
105
|
});
|
99
106
|
|
100
107
|
Task("Default")
|
data/tracks/csharp/build.ps1
CHANGED
data/tracks/csharp/build.sh
CHANGED
@@ -7,63 +7,54 @@ public class PangramTest
|
|
7
7
|
[Fact]
|
8
8
|
public void Sentence_empty()
|
9
9
|
{
|
10
|
-
|
11
|
-
Assert.False(Pangram.IsPangram(input));
|
10
|
+
Assert.False(Pangram.IsPangram(""));
|
12
11
|
}
|
13
12
|
|
14
13
|
[Fact(Skip = "Remove to run test")]
|
15
14
|
public void Pangram_with_only_lower_case()
|
16
15
|
{
|
17
|
-
|
18
|
-
Assert.True(Pangram.IsPangram(input));
|
16
|
+
Assert.True(Pangram.IsPangram("the quick brown fox jumps over the lazy dog"));
|
19
17
|
}
|
20
18
|
|
21
19
|
[Fact(Skip = "Remove to run test")]
|
22
20
|
public void Missing_character_x()
|
23
21
|
{
|
24
|
-
|
25
|
-
Assert.False(Pangram.IsPangram(input));
|
22
|
+
Assert.False(Pangram.IsPangram("a quick movement of the enemy will jeopardize five gunboats"));
|
26
23
|
}
|
27
24
|
|
28
25
|
[Fact(Skip = "Remove to run test")]
|
29
26
|
public void Another_missing_character_x()
|
30
27
|
{
|
31
|
-
|
32
|
-
Assert.False(Pangram.IsPangram(input));
|
28
|
+
Assert.False(Pangram.IsPangram("the quick brown fish jumps over the lazy dog"));
|
33
29
|
}
|
34
30
|
|
35
31
|
[Fact(Skip = "Remove to run test")]
|
36
32
|
public void Pangram_with_underscores()
|
37
33
|
{
|
38
|
-
|
39
|
-
Assert.True(Pangram.IsPangram(input));
|
34
|
+
Assert.True(Pangram.IsPangram("the_quick_brown_fox_jumps_over_the_lazy_dog"));
|
40
35
|
}
|
41
36
|
|
42
37
|
[Fact(Skip = "Remove to run test")]
|
43
38
|
public void Pangram_with_numbers()
|
44
39
|
{
|
45
|
-
|
46
|
-
Assert.True(Pangram.IsPangram(input));
|
40
|
+
Assert.True(Pangram.IsPangram("the 1 quick brown fox jumps over the 2 lazy dogs"));
|
47
41
|
}
|
48
42
|
|
49
43
|
[Fact(Skip = "Remove to run test")]
|
50
44
|
public void Missing_letters_replaced_by_numbers()
|
51
45
|
{
|
52
|
-
|
53
|
-
Assert.False(Pangram.IsPangram(input));
|
46
|
+
Assert.False(Pangram.IsPangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"));
|
54
47
|
}
|
55
48
|
|
56
49
|
[Fact(Skip = "Remove to run test")]
|
57
50
|
public void Pangram_with_mixed_case_and_punctuation()
|
58
51
|
{
|
59
|
-
|
60
|
-
Assert.True(Pangram.IsPangram(input));
|
52
|
+
Assert.True(Pangram.IsPangram("\"Five quacking Zephyrs jolt my wax bed.\""));
|
61
53
|
}
|
62
54
|
|
63
55
|
[Fact(Skip = "Remove to run test")]
|
64
56
|
public void Upper_and_lower_case_versions_of_the_same_character_should_not_be_counted_separately()
|
65
57
|
{
|
66
|
-
|
67
|
-
Assert.False(Pangram.IsPangram(input));
|
58
|
+
Assert.False(Pangram.IsPangram("the quick brown fox jumps over with lazy FX"));
|
68
59
|
}
|
69
60
|
}
|
@@ -8,15 +8,14 @@ namespace Generators
|
|
8
8
|
public abstract class Exercise
|
9
9
|
{
|
10
10
|
private static readonly ExerciseWriter ExerciseWriter = new ExerciseWriter();
|
11
|
-
|
11
|
+
private CanonicalData _canonicalData { get; set; }
|
12
|
+
|
12
13
|
public string Name => GetType().ToExerciseName();
|
13
14
|
|
14
|
-
protected CanonicalData CanonicalData { get; private set; }
|
15
|
-
|
16
15
|
public void Regenerate(CanonicalData canonicalData)
|
17
16
|
{
|
18
|
-
|
19
|
-
UpdateCanonicalData(
|
17
|
+
_canonicalData = canonicalData;
|
18
|
+
UpdateCanonicalData(canonicalData);
|
20
19
|
|
21
20
|
ExerciseWriter.WriteToFile(this);
|
22
21
|
}
|
@@ -31,7 +30,7 @@ protected virtual void UpdateCanonicalData(CanonicalData canonicalData)
|
|
31
30
|
{
|
32
31
|
ClassName = Name.ToTestClassName(),
|
33
32
|
Methods = RenderTestMethods(),
|
34
|
-
CanonicalDataVersion =
|
33
|
+
CanonicalDataVersion = _canonicalData.Version,
|
35
34
|
UsingNamespaces = GetUsingNamespaces()
|
36
35
|
};
|
37
36
|
|
@@ -39,13 +38,13 @@ protected virtual HashSet<string> GetUsingNamespaces()
|
|
39
38
|
{
|
40
39
|
var usingNamespaces = new HashSet<string> { "Xunit" };
|
41
40
|
|
42
|
-
foreach (var canonicalDataCase in
|
41
|
+
foreach (var canonicalDataCase in _canonicalData.Cases.Where(canonicalDataCase => canonicalDataCase.ExceptionThrown != null))
|
43
42
|
usingNamespaces.Add(canonicalDataCase.ExceptionThrown.Namespace);
|
44
43
|
|
45
44
|
return usingNamespaces;
|
46
45
|
}
|
47
46
|
|
48
|
-
protected virtual string[] RenderTestMethods() =>
|
47
|
+
protected virtual string[] RenderTestMethods() => _canonicalData.Cases.Select(RenderTestMethod).ToArray();
|
49
48
|
|
50
49
|
protected virtual string RenderTestMethod(CanonicalDataCase canonicalDataCase, int index) => CreateTestMethod(canonicalDataCase, index).Render();
|
51
50
|
|
@@ -70,20 +69,20 @@ protected virtual TestMethodBody CreateTestMethodBody(CanonicalDataCase canonica
|
|
70
69
|
{
|
71
70
|
if (canonicalDataCase.ExceptionThrown != null)
|
72
71
|
{
|
73
|
-
return new TestMethodBodyWithExceptionCheck(canonicalDataCase,
|
72
|
+
return new TestMethodBodyWithExceptionCheck(canonicalDataCase, _canonicalData);
|
74
73
|
}
|
75
74
|
|
76
75
|
if (canonicalDataCase.Expected is bool)
|
77
76
|
{
|
78
|
-
return new TestMethodBodyWithBooleanCheck(canonicalDataCase,
|
77
|
+
return new TestMethodBodyWithBooleanCheck(canonicalDataCase, _canonicalData);
|
79
78
|
}
|
80
79
|
|
81
80
|
if (canonicalDataCase.Expected is null)
|
82
81
|
{
|
83
|
-
return new TestMethodBodyWithNullCheck(canonicalDataCase,
|
82
|
+
return new TestMethodBodyWithNullCheck(canonicalDataCase, _canonicalData);
|
84
83
|
}
|
85
84
|
|
86
|
-
return new TestMethodBodyWithEqualityCheck(canonicalDataCase,
|
85
|
+
return new TestMethodBodyWithEqualityCheck(canonicalDataCase, _canonicalData);
|
87
86
|
}
|
88
87
|
|
89
88
|
protected virtual string RenderTestMethodBodyArrange(TestMethodBody testMethodBody)
|
@@ -7,13 +7,13 @@ public class AllYourBase : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.Input["input_digits"] = canonicalDataCase.Input["input_digits"].ConvertToEnumerable<int>();
|
13
13
|
|
14
14
|
canonicalDataCase.ExceptionThrown = canonicalDataCase.Expected is null ? typeof(ArgumentException) : null;
|
15
15
|
canonicalDataCase.UseVariablesForInput = true;
|
16
|
-
canonicalDataCase.UseVariableForExpected =
|
16
|
+
canonicalDataCase.UseVariableForExpected = true;
|
17
17
|
}
|
18
18
|
}
|
19
19
|
}
|
@@ -10,7 +10,7 @@ public class Allergies : Exercise
|
|
10
10
|
{
|
11
11
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
12
12
|
{
|
13
|
-
foreach (var canonicalDataCase in
|
13
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
14
14
|
{
|
15
15
|
if (canonicalDataCase.Property == "allergicTo")
|
16
16
|
{
|
@@ -9,7 +9,7 @@ public class Alphametics : Exercise
|
|
9
9
|
{
|
10
10
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
11
11
|
{
|
12
|
-
foreach (var canonicalDataCase in
|
12
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
13
13
|
{
|
14
14
|
canonicalDataCase.UseVariableForExpected = true;
|
15
15
|
canonicalDataCase.UseVariableForTested = true;
|
@@ -7,7 +7,7 @@ public class Anagram : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.ConstructorInput = new Dictionary<string, object>
|
13
13
|
{
|
@@ -6,7 +6,7 @@ public class BeerSong : Exercise
|
|
6
6
|
{
|
7
7
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
8
8
|
{
|
9
|
-
foreach (var canonicalDataCase in
|
9
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
10
10
|
canonicalDataCase.UseVariableForExpected = true;
|
11
11
|
}
|
12
12
|
}
|
@@ -7,7 +7,7 @@ public class BinarySearch : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.ConstructorInput = new Dictionary<string, object>
|
13
13
|
{
|
@@ -7,7 +7,7 @@ public class BookStore : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.Input = new Dictionary<string, object>
|
13
13
|
{
|
@@ -6,7 +6,7 @@ public class BracketPush : Exercise
|
|
6
6
|
{
|
7
7
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
8
8
|
{
|
9
|
-
foreach (var canonicalDataCase in
|
9
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
10
10
|
{
|
11
11
|
canonicalDataCase.Input["input"] = ((string)canonicalDataCase.Input["input"]).Replace("\\", "\\\\");
|
12
12
|
canonicalDataCase.UseVariablesForInput = true;
|
@@ -5,9 +5,9 @@ namespace Generators.Exercises
|
|
5
5
|
{
|
6
6
|
public class CollatzConjecture : Exercise
|
7
7
|
{
|
8
|
-
protected override void UpdateCanonicalData(CanonicalData
|
8
|
+
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.ExceptionThrown = (long)canonicalDataCase.Input["number"] <= 0 ? typeof(ArgumentException) : null;
|
13
13
|
}
|
@@ -7,7 +7,7 @@ public class CryptoSquare : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.UseVariablesForInput = true;
|
13
13
|
canonicalDataCase.UseVariableForExpected = true;
|
@@ -6,7 +6,7 @@ public class FoodChain : Exercise
|
|
6
6
|
{
|
7
7
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
8
8
|
{
|
9
|
-
foreach (var canonicalDataCase in
|
9
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
10
10
|
{
|
11
11
|
canonicalDataCase.Expected = canonicalDataCase.Expected.ConvertMultiLineString();
|
12
12
|
canonicalDataCase.UseVariableForExpected = true;
|
@@ -9,7 +9,7 @@ public class Gigasecond : Exercise
|
|
9
9
|
{
|
10
10
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
11
11
|
{
|
12
|
-
foreach (var canonicalDataCase in
|
12
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
13
13
|
{
|
14
14
|
// Update input
|
15
15
|
var input = DateTime.Parse(canonicalDataCase.Input["input"].ToString());
|
@@ -7,7 +7,7 @@ public class Hamming : Exercise
|
|
7
7
|
{
|
8
8
|
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
9
9
|
{
|
10
|
-
foreach (var canonicalDataCase in
|
10
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
11
11
|
{
|
12
12
|
canonicalDataCase.ExceptionThrown = canonicalDataCase.Expected is long ? null : typeof(ArgumentException);
|
13
13
|
}
|