diff --git a/tests/data/root_config_complex.toml b/tests/data/root_config_complex.toml index c5074e6..63b9589 100644 --- a/tests/data/root_config_complex.toml +++ b/tests/data/root_config_complex.toml @@ -2,13 +2,15 @@ mod_location = "mods" download_location = "downloads" nexus_api_key = "1234" -[games.sse] +[games.example_game] path = "/home/user/games/sse" +[games.sse] +path = "games/sse" + [instances.example1] path = "example1.toml" - [instances.example2] path = "/home/user/example2.toml" @@ -26,3 +28,6 @@ path = "mod2" [mods.mod3] path = "mod3" + +[mods.add_test_1] +path = "add_test_1" diff --git a/tests/root_config_test.rs b/tests/root_config_test.rs index 848d486..91e0858 100644 --- a/tests/root_config_test.rs +++ b/tests/root_config_test.rs @@ -34,11 +34,18 @@ fn parse_complex() { assert!( config - .game_by_id("sse") + .game_by_id("example_game") .is_some_and(|e| e.install_location() == "/home/user/games/sse"), "Installed game wrong path" ); + assert!( + config + .game_by_id("sse") + .is_some_and(|e| e.install_location().ends_with("games/sse")), + "Installed game wrong path" + ); + assert!(config.game_by_id("starfield").is_none()); assert!(config.mod_by_id("mod1").is_some());