diff --git a/src/shader.rs b/src/shader.rs index 7494932..f4db914 100644 --- a/src/shader.rs +++ b/src/shader.rs @@ -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); + } } \ No newline at end of file