ci / test (postgres) (push) Successful in 1m24s
ci / test (sqlite) (push) Successful in 1m35s
ci / image (push) Successful in 16s
ci / test (postgres) (pull_request) Successful in 1m11s
ci / test (sqlite) (pull_request) Successful in 1m24s
ci / image (pull_request) Successful in 14s
The independent review found that the policy tests could be bypassed: Microsoft-named direct packages and GlobalPackageReference slipped past the dependency check, the live-money scan missed the JSON, Dockerfile and Unraid template forms, the secret scan missed short project secrets but would have failed on the user's own ignored .env. The scans now read only the files git would commit and cover those cases. Also adds the fixed-seed generator for property tests, the REGISTRY variables reserved for phase 9 in the CI, a git pre-commit hook in place of the pre-commit tool (tasks hooks), the missing SPEC 4 facts in API-NOTES (Fed/ECB/BLS times, USDC depth on OKX) and the full list of today's indirect packages. refs #3 refs #5 refs #6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
namespace Anubis.Tests;
|
|
|
|
[TestClass]
|
|
public sealed class PropertyTests
|
|
{
|
|
[TestMethod]
|
|
[TestCategory(Category.Golden)]
|
|
public void SplitMix64MatchesTheReferenceSequence()
|
|
{
|
|
// First output of the published SplitMix64 reference for seed 0.
|
|
Assert.AreEqual(0xE220A8397B1DCDAFUL, new Gen(0).NextUInt64());
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(Category.Unit)]
|
|
public void SameSeedGivesTheSameSequence()
|
|
{
|
|
var a = new Gen(42);
|
|
var b = new Gen(42);
|
|
for (var i = 0; i < 100; i++)
|
|
{
|
|
Assert.AreEqual(a.NextUInt64(), b.NextUInt64());
|
|
}
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(Category.Unit)]
|
|
public void IntegersStayInRange()
|
|
{
|
|
Property.ForAll(g => (Value: g.Int(-3, 4), Wide: g.Long(long.MinValue, long.MaxValue)), x =>
|
|
{
|
|
Assert.IsTrue(x.Value is >= -3 and < 4, x.ToString());
|
|
Assert.AreNotEqual(long.MaxValue, x.Wide);
|
|
});
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(Category.Unit)]
|
|
public void DecimalsRespectBoundsAndScale()
|
|
{
|
|
Property.ForAll(g => g.Decimal(0.00000001m, 70000m, 8), value =>
|
|
{
|
|
Assert.IsTrue(value is >= 0.00000001m and <= 70000m);
|
|
Assert.AreEqual(value, decimal.Round(value, 8));
|
|
}, cases: 1000);
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(Category.Unit)]
|
|
public void DoublesAreInTheUnitInterval()
|
|
{
|
|
Property.ForAll(g => g.Double(), value => Assert.IsTrue(value is >= 0.0 and < 1.0));
|
|
}
|
|
|
|
[TestMethod]
|
|
[TestCategory(Category.Unit)]
|
|
public void FailureNamesSeedAndCase()
|
|
{
|
|
var error = Assert.ThrowsExactly<AssertFailedException>(() =>
|
|
Property.ForAll(g => g.Int(0, 10), value => Assert.IsTrue(value < 5), seed: 7));
|
|
|
|
Assert.Contains("seme 7", error.Message);
|
|
}
|
|
}
|