Skip to content

Commit

Permalink
Mark 76 as slow in C#, JS (but it's *really* close to 60s)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 30, 2024
1 parent 4128980 commit 3a34dce
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ rust/target
**/.coverage
**/.coverage.*
**/coverage
**/dist/*
27 changes: 14 additions & 13 deletions csharp/Euler.Test/test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ public class EulerTest
private readonly TimeSpan oneMinute = new TimeSpan(0, 1, 0);
public static IEnumerable<object[]> 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);
Expand All @@ -31,7 +31,8 @@ public async Task EulerTest_Problem(Type problem, object expected)
object result = await prob.Answer();

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (3, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (5, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (6, macos-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (6, macos-13)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (8, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (7, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (6, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (2, ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (6, windows-latest)

Dereference of a possibly null reference.

Check warning on line 31 in csharp/Euler.Test/test.cs

View workflow job for this annotation

GitHub Actions / csharp (9, ubuntu-latest)

Dereference of a possibly null reference.
sw.Stop();
Assert.Equal(expected, result);
Assert.True(sw.Elapsed <= oneMinute);
if (!isSlow)
Assert.True(sw.Elapsed <= oneMinute);
}
}
}
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`| |
+-----------+------------+------------+------------+------------+------------+------------+
Expand Down
2 changes: 1 addition & 1 deletion javascript/euler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3a34dce

Please sign in to comment.