Skip to content

Commit 685d010

Browse files
Minor refactoring
1 parent 079fcd9 commit 685d010

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

generators.new/CanonicalData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ private static void UpdateProbSpecsRepo()
3939
Commands.Pull(repo, new Signature("Exercism", "[email protected]", DateTimeOffset.Now), new PullOptions());
4040
}
4141

42-
internal static TestCase[] Parse(string canonicalDataFile) =>
43-
Parse(JsonNode.Parse(File.ReadAllText(canonicalDataFile))!.AsObject(), ImmutableQueue<string>.Empty)
42+
internal static TestCase[] Parse(Exercise exercise) =>
43+
Parse(JsonNode.Parse(File.ReadAllText(Paths.CanonicalDataFile(exercise)))!.AsObject(), ImmutableQueue<string>.Empty)
4444
.ToArray();
4545

4646
private static IEnumerable<TestCase> Parse(JsonObject jsonObject, ImmutableQueue<string> path)

generators.new/TestGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ internal static void GenerateTestsFromTemplate(Exercise exercise)
66
{
77
Console.WriteLine($"{exercise.Slug}: generating tests...");
88

9-
var excludedTestCaseIds = TestsToml.ExcludedTestCaseIds(Paths.TestsTomlFile(exercise));
10-
var testCases = CanonicalData.Parse(Paths.CanonicalDataFile(exercise))
9+
var excludedTestCaseIds = TestsToml.ExcludedTestCaseIds(exercise);
10+
var testCases = CanonicalData.Parse(exercise)
1111
.Where(testCase => !excludedTestCaseIds.Contains(testCase.Uuid))
1212
.ToArray();
1313

generators.new/TestsToml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ namespace Generators;
55

66
internal static class TestsToml
77
{
8-
internal static HashSet<string> ExcludedTestCaseIds(string testsTomlFile) =>
9-
Toml.ToModel(File.ReadAllText(testsTomlFile))
8+
internal static HashSet<string> ExcludedTestCaseIds(Exercise exercise) =>
9+
Toml.ToModel(File.ReadAllText(Paths.TestsTomlFile(exercise)))
1010
.Where(IsExcluded)
1111
.Select(table => table.Key)
1212
.ToHashSet();

0 commit comments

Comments
 (0)