Adding shader test

This commit is contained in:
Skye Terran 2022-03-03 23:09:46 -08:00
parent cccc62e5a8
commit 0b9a68c906
1 changed files with 18 additions and 0 deletions

View File

@ -67,4 +67,22 @@ pub fn add_includes(source: &String) -> String {
}
combined
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn preprocess_file() {
// Generate a shader and preprocess it
let mut source = read_to_string("src/shader.wgsl").unwrap();
source = add_includes(&source);
// Parse the WGSL into a usable module
let module = parse_wgsl(&source);
// Generate a valid WGSL string from the module
let gen_wgsl = generate_wgsl(&module);
}
}