Skip to content

Commit

Permalink
test weird mac error
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLloyd committed Apr 27, 2024
1 parent 144287d commit 9dbc23b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Tests/Allocator_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using CsCheck;
using ImTools;
using Rationals;
using Xunit;

Expand Down Expand Up @@ -419,8 +420,13 @@ public void Allocate_NegativeExample()
[Fact]
public void Allocate_Exceptions()
{
Assert.Throws<Exception>(() => Allocator.Allocate(0, [0.0, 0.0, 0.0]));
Assert.Throws<Exception>(() => Allocator.Allocate(42, [1.0, -2.0, 1.0, 0]));
var quantity = 0;
var weights_i = 0.0;
var sumWeights = 0.0;
var allocation = (int)Math.Round(quantity * weights_i / sumWeights, MidpointRounding.AwayFromZero);
Assert.Equal(int.MinValue, allocation);
//Assert.Throws<Exception>(() => Allocator.Allocate(0, [0.0, 0.0, 0.0]));
//Assert.Throws<Exception>(() => Allocator.Allocate(42, [1.0, -2.0, 1.0, 0]));
}

[Fact]
Expand Down

0 comments on commit 9dbc23b

Please sign in to comment.