FlowFieldTests: assert the flow moved and scaled on probes where the field is nonzero (the origin is a zero of the field)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f9eaee7c10
commit
c87809cf7b
1 changed files with 6 additions and 8 deletions
|
|
@ -89,8 +89,9 @@ public sealed class FlowFieldTests : IDisposable
|
|||
Assert.Equal(1.0, coarse.Time, 4);
|
||||
foreach (var p in Probes) AssertClose(fine.Flow(p), coarse.Flow(p));
|
||||
Assert.Equal(fine.FlowScroll, coarse.FlowScroll, 5);
|
||||
// The flow moved: a scroll of 0.025 per second is a different field from the start.
|
||||
Assert.NotEqual(ZoneWith(Flow()).Flow(Probes[1]).y, fine.Flow(Probes[1]).y);
|
||||
// The flow moved: a scroll of 0.025 per second is a different field from the start, somewhere.
|
||||
var start = ZoneWith(Flow());
|
||||
Assert.Contains(Probes, p => length(start.Flow(p) - fine.Flow(p)) > .05f);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -144,11 +145,8 @@ public sealed class FlowFieldTests : IDisposable
|
|||
{
|
||||
var one = ZoneWith(Flow(amplitude: 15f), 3.0);
|
||||
var two = ZoneWith(Flow(amplitude: 30f), 3.0);
|
||||
foreach (var p in Probes)
|
||||
{
|
||||
var a = one.Flow(p);
|
||||
Assert.NotEqual(float3.zero, a);
|
||||
AssertClose(a * 2f, two.Flow(p));
|
||||
}
|
||||
foreach (var p in Probes) AssertClose(one.Flow(p) * 2f, two.Flow(p));
|
||||
// The flow is live (the origin is a legitimate zero of the field, so it is not every probe).
|
||||
Assert.Contains(Probes, p => length(one.Flow(p)) > 1f);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue