summaryrefslogtreecommitdiffstats
path: root/third_party/rust/naga/src/front/spv/rosetta.rs
blob: 027c0d0adc8d4e37c6198171af96cb971b8517e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::{fs, path::Path};

const TEST_PATH: &str = "test-data";

fn rosetta_test(file_name: &str) {
    if true {
        return; //TODO: fix this test
    }
    let file_path = Path::new(TEST_PATH).join(file_name);
    let input = fs::read(&file_path).unwrap();

    let module = super::parse_u8_slice(&input, &Default::default()).unwrap();
    let output = ron::ser::to_string_pretty(&module, Default::default()).unwrap();

    let expected = fs::read_to_string(file_path.with_extension("expected.ron")).unwrap();

    difference::assert_diff!(output.as_str(), expected.as_str(), "", 0);
}

#[test]
fn simple() {
    rosetta_test("simple/simple.spv")
}