Style fixes in generated code

This commit is contained in:
Deukhoofd 2023-04-02 12:32:54 +02:00
parent af29abdb1e
commit b4847d2a2c
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 7 additions and 12 deletions

View File

@ -7,11 +7,11 @@ fn main() {
.write_all( .write_all(
b"// This file is generated by build.rs b"// This file is generated by build.rs
use std::path::Path;
use std::fs::File;
use std::io::Read;
use super::common::TestCase; use super::common::TestCase;
use super::get_library; use super::get_library;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn integration_tests(input: &Path) { fn integration_tests(input: &Path) {
let mut str: String = \"\".to_string(); let mut str: String = \"\".to_string();
@ -21,7 +21,6 @@ fn integration_tests(input: &Path) {
println!(\"\tRunning integration test {}\", test_case.name); println!(\"\tRunning integration test {}\", test_case.name);
test_case.run_test(get_library()); test_case.run_test(get_library());
} }
", ",
) )
.unwrap(); .unwrap();
@ -41,8 +40,7 @@ fn integration_tests(input: &Path) {
fn {}() {{ fn {}() {{
integration_tests(Path::new(\"{}\")); integration_tests(Path::new(\"{}\"));
}} }}
",
",
file_name, file_name,
path.to_str().unwrap(), path.to_str().unwrap(),
) )

View File

@ -1,10 +1,10 @@
// This file is generated by build.rs // This file is generated by build.rs
use std::path::Path;
use std::fs::File;
use std::io::Read;
use super::common::TestCase; use super::common::TestCase;
use super::get_library; use super::get_library;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn integration_tests(input: &Path) { fn integration_tests(input: &Path) {
let mut str: String = "".to_string(); let mut str: String = "".to_string();
@ -15,10 +15,7 @@ fn integration_tests(input: &Path) {
test_case.run_test(get_library()); test_case.run_test(get_library());
} }
#[test] #[test]
fn basic_single_turn() { fn basic_single_turn() {
integration_tests(Path::new("tests/test_cases/basic_single_turn.yaml")); integration_tests(Path::new("tests/test_cases/basic_single_turn.yaml"));
} }