mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 01:08:25 +07:00
Fix tests
This commit is contained in:
@ -42,7 +42,7 @@ class UncivFiles(
|
|||||||
private val files: Files,
|
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 */
|
/** 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 {
|
init {
|
||||||
debug("Creating UncivFiles, localStoragePath: %s, externalStoragePath: %s",
|
debug("Creating UncivFiles, localStoragePath: %s, externalStoragePath: %s",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.unciv.models.translations
|
package com.unciv.models.translations
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx
|
||||||
import com.badlogic.gdx.files.FileHandle
|
import com.badlogic.gdx.files.FileHandle
|
||||||
import com.unciv.UncivGame
|
import com.unciv.UncivGame
|
||||||
import com.unciv.json.fromJsonFile
|
import com.unciv.json.fromJsonFile
|
||||||
@ -259,7 +260,7 @@ object TranslationFileWriter {
|
|||||||
|
|
||||||
// used for unit test only
|
// used for unit test only
|
||||||
fun getGeneratedStringsSize(): Int {
|
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
|
// exclude empty lines
|
||||||
it.count { line: String -> !line.startsWith(specialNewLineCode) }
|
it.count { line: String -> !line.startsWith(specialNewLineCode) }
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Taken from https://github.com/TomGrill/gdx-testing
|
// Taken from https://github.com/TomGrill/gdx-testing
|
||||||
package com.unciv.testing
|
package com.unciv.testing
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
import com.unciv.UncivGame
|
import com.unciv.UncivGame
|
||||||
import com.unciv.models.metadata.BaseRuleset
|
import com.unciv.models.metadata.BaseRuleset
|
||||||
@ -39,7 +40,7 @@ class BasicTests {
|
|||||||
@Test
|
@Test
|
||||||
fun gamePngExists() {
|
fun gamePngExists() {
|
||||||
Assert.assertTrue("This test will only pass when the game.png exists",
|
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
|
@Test
|
||||||
|
Reference in New Issue
Block a user