From 3a34dce32518eb5eb407fc2643e6fc513ad84cc4 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Tue, 30 Jul 2024 18:17:27 -0500 Subject: [PATCH] Mark 76 as slow in C#, JS (but it's *really* close to 60s) --- .gitignore | 1 + csharp/Euler.Test/test.cs | 27 ++++++++++++++------------- docs/index.rst | 2 +- javascript/euler.test.js | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index b56f10d5..20970bc4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ rust/target **/.coverage **/.coverage.* **/coverage +**/dist/* diff --git a/csharp/Euler.Test/test.cs b/csharp/Euler.Test/test.cs index 6fd5e0ef..d40d4c46 100644 --- a/csharp/Euler.Test/test.cs +++ b/csharp/Euler.Test/test.cs @@ -7,22 +7,22 @@ public class EulerTest private readonly TimeSpan oneMinute = new TimeSpan(0, 1, 0); public static IEnumerable Data() { - yield return new object[] { typeof(p0000), 0 }; - yield return new object[] { typeof(p0001), 233168 }; - yield return new object[] { typeof(p0002), 4613732 }; - yield return new object[] { typeof(p0004), 906609 }; - yield return new object[] { typeof(p0006), 25164150 }; - yield return new object[] { typeof(p0008), 23514624000 }; - yield return new object[] { typeof(p0009), 31875000 }; - yield return new object[] { typeof(p0011), 70600674 }; - yield return new object[] { typeof(p0017), 21124 }; - yield return new object[] { typeof(p0076), 190569291 }; - yield return new object[] { typeof(p0836), "aprilfoolsjoke" }; + yield return new object[] { typeof(p0000), false, 0 }; + yield return new object[] { typeof(p0001), false, 233168 }; + yield return new object[] { typeof(p0002), false, 4613732 }; + yield return new object[] { typeof(p0004), false, 906609 }; + yield return new object[] { typeof(p0006), false, 25164150 }; + yield return new object[] { typeof(p0008), false, 23514624000 }; + yield return new object[] { typeof(p0009), false, 31875000 }; + yield return new object[] { typeof(p0011), false, 70600674 }; + yield return new object[] { typeof(p0017), false, 21124 }; + yield return new object[] { typeof(p0076), true, 190569291 }; + yield return new object[] { typeof(p0836), false, "aprilfoolsjoke" }; } [Theory] [MemberData(nameof(Data))] - public async Task EulerTest_Problem(Type problem, object expected) + public async Task EulerTest_Problem(Type problem, bool isSlow, object expected) { IEuler? prob; prob = (IEuler?)Activator.CreateInstance(problem); @@ -31,7 +31,8 @@ public async Task EulerTest_Problem(Type problem, object expected) object result = await prob.Answer(); sw.Stop(); Assert.Equal(expected, result); - Assert.True(sw.Elapsed <= oneMinute); + if (!isSlow) + Assert.True(sw.Elapsed <= oneMinute); } } } diff --git a/docs/index.rst b/docs/index.rst index 7d927a51..f269b264 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -240,7 +240,7 @@ Key: +-----------+------------+------------+------------+------------+------------+------------+ |:prob:`74` | | | | |:py-d:`0074`| | +-----------+------------+------------+------------+------------+------------+------------+ -|:prob:`76` |:c-d:`0076` |:cp-d:`0076`|:cs-d:`0076`|:js-d:`0076`|:py-d:`0076`|:rs-d:`0076`| +|:prob:`76` |:c-d:`0076` |:cp-d:`0076`|:cs-s:`0076`|:js-s:`0076`|:py-d:`0076`|:rs-d:`0076`| +-----------+------------+------------+------------+------------+------------+------------+ |:prob:`77` | | | | |:py-d:`0077`| | +-----------+------------+------------+------------+------------+------------+------------+ diff --git a/javascript/euler.test.js b/javascript/euler.test.js index 975430fd..07245c7e 100644 --- a/javascript/euler.test.js +++ b/javascript/euler.test.js @@ -13,7 +13,7 @@ const answers = { 76: [require('./src/p0076.js'), 190569291], 836: [require('./src/p0836.js'), 'aprilfoolsjoke'], }; -const knownSlow = []; +const knownSlow = [76]; for (question in answers) { if (answers.hasOwnProperty(question)) {