TestSetRoot makes sure set root sets Files.root to the proper value.
(t *testing.T)
| 20 | |
| 21 | // TestSetRoot makes sure set root sets Files.root to the proper value. |
| 22 | func TestFilesSetRoot(t *testing.T) { |
| 23 | // Start an instance of engo |
| 24 | Run(RunOptions{ |
| 25 | NoRun: true, |
| 26 | HeadlessMode: true, |
| 27 | }, &assetTestScene{}) |
| 28 | |
| 29 | Files.SetRoot("testing") |
| 30 | if Files.root != "testing" { |
| 31 | t.Errorf("Root was not set to %v, it was %v instead", "testing", Files.root) |
| 32 | } |
| 33 | |
| 34 | if Files.GetRoot() != "testing" { |
| 35 | t.Errorf("Root was set, but GetRoot() did not return proper value. Wanted: %v, got: %v", "testing", Files.GetRoot()) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | type testLoader struct{} |
| 40 |