The mirror test compared a normalised reading of two spellings and was beaten twice (a statement before the return, gravityHeight's sum). GravityShader writes the whole file (potential, zero-strength guard, reference term, height sum) from GravityField's constant (TailOffset); GravityShaderTests fails on any difference. GravityShaderMirrorTests deleted. GravityFieldParityVerify opens Main Menu.unity: no ZoneRenderer there, its Fog Surface Displacement camera is the menu's own brush presentation (layers 9 and 10) by spec. Builds not yet verified on this commit; verified at the final merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.2 KiB
C#
23 lines
1.2 KiB
C#
using System;
|
|
using System.IO;
|
|
using Xunit;
|
|
|
|
// potential-owns-gravity (aetheria-gravity, cut grid-lowering): Assets/Shaders/Gravity.cginc is the output of
|
|
// GravityShader.Source(), which reads GravityField's constants and writes the one lowering of the potential, the
|
|
// zero-strength guard, each well's reference and gravityHeight's sum. The committed file must equal it, character for
|
|
// character (line ends aside): any added statement, respelling, flipped sign, swapped argument or macro fails here.
|
|
// To change the shader, change GravityShader and run once with AETHERIA_REGENERATE_GRAVITY_CGINC=1.
|
|
public sealed class GravityShaderTests
|
|
{
|
|
[Fact]
|
|
public void TheCommittedShaderIsTheGeneratedOne()
|
|
{
|
|
var path = Path.Combine(RunStartTests.FindRepoRoot(), GravityShader.Path);
|
|
if (Environment.GetEnvironmentVariable("AETHERIA_REGENERATE_GRAVITY_CGINC") == "1")
|
|
File.WriteAllText(path, GravityShader.Source());
|
|
var generated = GravityShader.Source();
|
|
// The law was generated, not an empty template agreeing with an empty file.
|
|
Assert.Contains("log(r / R) + 0.5", generated);
|
|
Assert.Equal(generated, File.ReadAllText(path).Replace("\r\n", "\n"));
|
|
}
|
|
}
|