Table of Contents

Class CompilerTests

Namespace
GrindFest
Assembly
GrindFest.dll

The bot-script compiler - the feature the whole game is built around.

public class CompilerTests : DevTest
Inheritance
object
CompilerTests
Inherited Members

Remarks

This class exists because a Linux player could not compile a single bot script and no test noticed. Every other DevTest takes its hero from CreateAndSelectRandomHero(), which builds a plain hero, so Compiler.CompileAndPrepareLocalHeroes was never in the path of any test.

The first test is deliberately a path-SHAPE assertion rather than a filesystem check. The bug was Application.persistentDataPath + @"\Scripts\": on Linux a backslash is a legal filename character, not a separator, so the string that reads like a directory is a single name, and every later read of Scripts.csproj inside it fails. Asserting the shape fails on Linux with that code and passes on Windows - which is exactly the asymmetry that let it live.

Methods

LocalScriptCompiles()

The end-to-end no other test reaches: write the script file a hero would get, then compile the directory the way the game does and require an assembly back.

ScriptsDirectoriesResolve()

The scripts directories must be directories. Catches the backslash regression with no I/O.