Skip to content

Commit

Permalink
to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedran bastien committed Dec 21, 2024
1 parent 4f6074d commit 675404f
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions src/new/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#[cfg(test)]
mod tests {
use crate::config::asconfig_json::{AsconfigcJson, CompilerOption};
use crate::config::get_tool_home;
use crate::utils::convert_pathbuf_to_string::Stringify;

#[test]
fn mod_files() {
use crate::new::template::create_mod_files;
Expand Down Expand Up @@ -66,29 +70,33 @@ def fini():

let ui_config_content =
read_to_string(mod_path.join("ui/asconfig.json")).unwrap();
assert_eq!(
ui_config_content,
"{
\"config\": \"flex\",
\"compilerOptions\": {
\"output\": \"\",
\"source-path\": [
\"src\"
],
\"external-library-path\": [
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\base_app-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\battle.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\common-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\common_i18n_library-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\gui_base-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\gui_battle-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\gui_lobby-1.0-SNAPSHOT.swc\",
\"C:\\\\Users\\\\cedran\\\\.wg-mod\\\\flash_lib\\\\lobby.swc\"
]
},
\"mainClass\": \"fr.gabouchet.BetterMatchmaking\"
}"
);
let wg_home = get_tool_home().unwrap();
let flash_lib_home = wg_home.join("flash_lib");
let lib_content = vec![
"base_app-1.0-SNAPSHOT.swc",
"battle.swc",
"common-1.0-SNAPSHOT.swc",
"common_i18n_library-1.0-SNAPSHOT.swc",
"gui_base-1.0-SNAPSHOT.swc",
"gui_battle-1.0-SNAPSHOT.swc",
"gui_lobby-1.0-SNAPSHOT.swc",
"lobby.swc",
];
let lib_content_path = lib_content
.iter()
.map(|filename| flash_lib_home.join(filename).to_string().unwrap())
.collect::<Vec<_>>();
let json_ui_config = AsconfigcJson {
config: "flex".to_string(),
compiler_option: CompilerOption {
output: "".to_string(),
source_path: vec!["src".to_string()],
library_path: lib_content_path,
},
main_class: "fr.gabouchet.BetterMatchmaking".to_string(),
};
let attended = serde_json::to_string_pretty(&json_ui_config).unwrap();
assert_eq!(ui_config_content, attended);

template_nvm_config(&mod_path).unwrap();
let nvm_config_content =
Expand Down

0 comments on commit 675404f

Please sign in to comment.