Skip to content

Commit

Permalink
further tidy, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLloyd committed Oct 13, 2024
1 parent 9a1d990 commit 00538a7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CsCheck/CsCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ BREAKING CHANGES:
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.169" PrivateAssets="All" />
<None Include="../CsCheck.png" Pack="true" PackagePath="" Visible="False" />
<None Include="../README.md" Pack="true" PackagePath="" Visible="False" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion CsCheck/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record LogContext<T>(T Value, bool Success);

public enum LogProcessor
{
Tyche
Tyche,
}

public static Func<(Func<Task> loggingTask, Channel<LogContext<T>>)> CreateLogger<T>(StreamWriter w, LogProcessor p, string propertyUnderTest)
Expand Down Expand Up @@ -52,6 +52,7 @@ public enum LogProcessor
}
}

#pragma warning disable IDE1006 // Naming Styles
public record TycheData(string type, double run_start, string property, string status, string representation,
string? status_reason, Dictionary<string, string> arguments, string? how_generated, Dictionary<string, string> features,
Dictionary<string, string>? coverage, Dictionary<string, string> timing, Dictionary<string, string> metadata);
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This gives the following advantages over tree based shrinking libraries:

See [why](https://github.com/AnthonyLloyd/CsCheck/blob/master/Why.md) you should use it, the [comparison](https://github.com/AnthonyLloyd/CsCheck/blob/master/Comparison.md) with other random testing libraries, or how CsCheck does in the [shrinking challenge](https://github.com/jlink/shrinking-challenge).
In one [shrinking challenge test](https://github.com/jlink/shrinking-challenge/blob/main/challenges/binheap.md) CsCheck managed to shrink to a new smaller example than was thought possible and is not reached by any other testing library.
CsCheck is the only random testing library that can always shrink to the simplest example (given enough time).

CsCheck also has functionality to make multiple types of testing simple and fast:

Expand Down
2 changes: 1 addition & 1 deletion Tests/GenLogsTest.cs → Tests/LoggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text.Json;
using CsCheck;

public class GenLogsTest
public class LoggingTest
{
static int[] Tally(int n, int[] ia)
{
Expand Down
11 changes: 6 additions & 5 deletions Tests/PCGTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,16 @@ public void PCG_Multiplier_Is_Not_Faster()
);
}

static void Ignore<T>(T _) { }

[Fact]
public void PCG_New_Is_Not_Faster()
{
Gen.Select(Gen.UInt, Gen.ULong, Gen.UInt[1, 10_000])
.Select((i, s, m) => (new PCG(i, s), new PCGTest(i, s), m))
.Faster(
(_, n, m) => { n.Next(m); },
(o, _, m) => { o.Next(m); },
(_, n, m) => Ignore(n.Next(m)),
(o, _, m) => Ignore(o.Next(m)),
repeat: 100,
raiseexception: false,
writeLine: output.WriteLine
Expand All @@ -241,8 +243,8 @@ public void PCG_Lemire_Is_Faster()
Gen.Select(Gen.UInt, Gen.ULong, Gen.UInt[1, 10_000])
.Select((i, s, m) => (new PCG(i, s), new PCGTest(i, s), m, ((ulong)-m) % m))
.Faster(
(_, n, m, t) => { n.NextLemire(m, t); },
(o, _, m, _) => { o.Next(m); },
(_, n, m, t) => Ignore(n.NextLemire(m, t)),
(o, _, m, _) => Ignore(o.Next(m)),
repeat: 100,
raiseexception: false,
writeLine: output.WriteLine
Expand Down Expand Up @@ -333,5 +335,4 @@ public static PCGTest Parse(string seed)
return new PCGTest((stream << 1) | 1UL, state);
}
}

}
7 changes: 2 additions & 5 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
<NoWarn>xUnit1004</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />
<PackageReference Include="Rationals" Version="2.3.0" />
<ProjectReference Include="..\CsCheck\CsCheck.csproj" />
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<Folder Include="Logging\" />
</ItemGroup>
</Project>

0 comments on commit 00538a7

Please sign in to comment.