()
| 153 | |
| 154 | #[test] |
| 155 | fn include_guard() { |
| 156 | // Same header included twice should appear once. |
| 157 | let src = table(&[ |
| 158 | ("a.wgsl", "#include \"h.wgsl\"\n#include \"h.wgsl\"\nmain\n"), |
| 159 | ("h.wgsl", "HEADER_BODY\n"), |
| 160 | ]); |
| 161 | let out = process(&src, "a.wgsl").unwrap(); |
| 162 | let count = out.matches("HEADER_BODY").count(); |
| 163 | assert_eq!(count, 1); |
| 164 | } |
| 165 | |
| 166 | #[test] |
| 167 | fn missing_is_error() { |