mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 00:39:56 +07:00
Fix tests
This commit is contained in:
@ -42,7 +42,7 @@ class UncivFiles(
|
||||
private val files: Files,
|
||||
|
||||
/** If not null, this is the path to the directory in which to store the local files - mods, saves, maps, etc */
|
||||
val customDataDirectory: String?
|
||||
val customDataDirectory: String? = null
|
||||
) {
|
||||
init {
|
||||
debug("Creating UncivFiles, localStoragePath: %s, externalStoragePath: %s",
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.unciv.models.translations
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.files.FileHandle
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.json.fromJsonFile
|
||||
@ -259,7 +260,7 @@ object TranslationFileWriter {
|
||||
|
||||
// used for unit test only
|
||||
fun getGeneratedStringsSize(): Int {
|
||||
return GenerateStringsFromJSONs(UncivGame.Current.files.getLocalFile("jsons/Civ V - Vanilla")).values.sumOf {
|
||||
return GenerateStringsFromJSONs(Gdx.files.local("jsons/Civ V - Vanilla")).values.sumOf {
|
||||
// exclude empty lines
|
||||
it.count { line: String -> !line.startsWith(specialNewLineCode) }
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Taken from https://github.com/TomGrill/gdx-testing
|
||||
package com.unciv.testing
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.unciv.Constants
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.models.metadata.BaseRuleset
|
||||
@ -39,7 +40,7 @@ class BasicTests {
|
||||
@Test
|
||||
fun gamePngExists() {
|
||||
Assert.assertTrue("This test will only pass when the game.png exists",
|
||||
UncivGame.Current.files.getDataFolder().list().any { it.name().endsWith(".png") })
|
||||
Gdx.files.local("").list().any { it.name().endsWith(".png") })
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user