Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion QuickFuzzr.Benchmarks/QuickFuzzr.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
<PackageReference Include="QuickPulse.Show" Version="0.1.9" />
<PackageReference Include="QuickPulse.Show" Version="0.1.10" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions QuickFuzzr.Tests/QuickFuzzr.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="QuickAcid" Version="0.0.2" />
<!-- <PackageReference Include="QuickPulse" Version="0.3.2" /> -->
<PackageReference Include="QuickPulse.Explains" Version="0.3.9" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\QuickFuzzr\QuickFuzzr.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="QuickCheckr" Version="0.0.1" />
<PackageReference Include="QuickPulse.Explains" Version="0.3.10" />
</ItemGroup>

<ItemGroup>
<!-- <ProjectReference Include="..\..\QuickAcid\QuickAcid\QuickAcid.csproj" /> -->
<!-- <ProjectReference Include="..\..\QuickCheckr\QuickCheckr\QuickCheckr.csproj" /> -->
<!-- <ProjectReference Include="..\..\QuickPulse.Explains\QuickPulse.Explains\QuickPulse.Explains.csproj" /> -->
</ItemGroup>

Expand Down
43 changes: 21 additions & 22 deletions QuickFuzzr.Tests/_Tools/CheckIf.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Diagnostics;
using QuickAcid;
using QuickAcid.Bolts;
using QuickCheckr;
using QuickCheckr.UnderTheHood;
using QuickFuzzr;
using QuickPulse;
using StringExtensionCombinators;

namespace QuickFuzzr.Tests._Tools;

Expand Down Expand Up @@ -37,17 +36,17 @@ public static void GeneratedValuesShouldEventuallySatisfyAll<T>(
params (string, Func<T, bool>)[] labeledChecks)
{
var signal = Signal.From<T>(a => Pulse.Trace(a!));
var run =
from inspector in "inspector".Stashed(
var check =
from inspector in Trackr.Stashed(
() => signal.SetAndReturnArtery(new DistinctValueInspector<T>()))
from input in "Fuzzr".Input(fuzzr)
from inspect in "Inspect".Act(() => signal.Pulse(input))
from _e in "early exit".TestifyProvenWhen(
from input in Checkr.Input("Fuzzr", fuzzr)
from inspect in Checkr.Act("Inspect", () => signal.Pulse(input))
from _e in Trackr.ProvenWhen("early exit",
() => inspector.SeenSatisfyEach([.. labeledChecks.Select(a => a.Item2)]))
from _s in "Assayer".Assay(
from _s in Trackr.Assay("Assayer",
[.. labeledChecks.Select(a => (a.Item1, (Func<bool>)(() => inspector.HasValueThatSatisfies(a.Item2))))])
select Acid.Test;
QState.Run(run).WithOneRun().And(numberOfExecutions.ExecutionsPerRun());
select Case.Closed;
check.Run(numberOfExecutions.ExecutionsPerRun());
}

[StackTraceHidden]
Expand All @@ -64,21 +63,21 @@ public static void GeneratedValuesShouldAllSatisfy<T>(
FuzzrOf<T> fuzzr,
params (string, Func<T, bool>)[] labeledChecks)
{
var run =
from input in "Fuzzr".Input(fuzzr)
from t in "input".Trace(() => input.ToString()!)
from _ in CombineSpecs(input, labeledChecks) // Move this to QuickAcid
select Acid.Test;
QState.Run(run).WithOneRun().And(numberOfExecutions.ExecutionsPerRun());
var check =
from input in Checkr.Input("Fuzzr", fuzzr)
from t in Checkr.Trace("input", () => input.ToString()!)
from _ in CombineSpecs(input, labeledChecks) // Move this to QuickCheckr maybe
select Case.Closed;
check.Run(numberOfExecutions.ExecutionsPerRun());
}

private static QAcidScript<Acid> CombineSpecs<T>(T input, IEnumerable<(string, Func<T, bool>)> checks)
private static CheckrOf<Case> CombineSpecs<T>(T input, IEnumerable<(string, Func<T, bool>)> checks)
{
return checks
.Select(c => c.Item1.Spec(() => c.Item2(input)))
.Aggregate(Acc, (acc, next) => from _ in acc from __ in next select Acid.Test);
.Select(c => Checkr.Spec(c.Item1, () => c.Item2(input)))
.Aggregate(Acc, (acc, next) => from _ in acc from __ in next select Case.Closed);
}

private static readonly QAcidScript<Acid> Acc =
s => Vessel.AcidOnly(s);
private static readonly CheckrOf<Case> Acc =
s => CheckrResult.CaseOnly(s);
}