Debian Codegraph @

third_party/rust/glsl/tests/missing_zero_float.rs

raw
1 extern crate glsl;
2
3 use glsl::parser::Parse;
4 use glsl::syntax::TranslationUnit;
5
6 #[test]
7 fn missing_zero_float_is_valid() {
8 let r = TranslationUnit::parse(
9 "
10 void main() {
11 float x = 1. * .5;
12 }",
13 );
14
15 assert!(r.is_ok());
16 }
17
18 #[test]
19 fn float_exp_is_valid() {
20 let r = TranslationUnit::parse(
21 "
22 void main() {
23 float x = 1e-5;
24 }",
25 );
26
27 assert!(r.is_ok());
28 }