Skip to content

Commit

Permalink
Add test for "d" mtl command
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Oom committed Jun 27, 2024
1 parent bc5ed2a commit af7f9ec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wavefront/src/mtl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ mod tests {
mtl_test("newmtl m1\nKd 1. 2. 3.").materials[0].diffuse_reflection,
[1., 2., 3.]
);
assert_eq!(
mtl_test("newmtl m1\nmap_Kd file.png").materials[0].diffuse_map,
"file.png"
);
assert_eq!(
mtl_test("newmtl m1\nKs 1. 2. 3.").materials[0].specular_reflection,
[1., 2., 3.]
Expand All @@ -224,15 +228,12 @@ mod tests {
mtl_test("newmtl m1\nNi 0.5").materials[0].index_of_refraction,
0.5
);
assert_eq!(mtl_test("newmtl m1\nd 1.0").materials[0].transparency, 0.0);
assert_eq!(mtl_test("newmtl m1\nTr 0.5").materials[0].transparency, 0.5);
assert_eq!(
mtl_test("newmtl m1\nspecularroughness 1.").materials.len(),
1
);
assert_eq!(
mtl_test("newmtl m1\nmap_Kd file.png").materials[0].diffuse_map,
"file.png"
);
}

#[test]
Expand Down

0 comments on commit af7f9ec

Please sign in to comment.