gecko-dev/third_party/rust/glsl/tests/missing_zero_float.rs
Lee Salzman 739b23d170 Bug 1612941 - vendor SWGL's rust dependencies. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D65617

--HG--
extra : moz-landing-system : lando
2020-03-13 18:24:40 +00:00

28 lines
398 B
Rust

extern crate glsl;
use glsl::parser::Parse;
use glsl::syntax::TranslationUnit;
#[test]
fn missing_zero_float_is_valid() {
let r = TranslationUnit::parse(
"
void main() {
float x = 1. * .5;
}",
);
assert!(r.is_ok());
}
#[test]
fn float_exp_is_valid() {
let r = TranslationUnit::parse(
"
void main() {
float x = 1e-5;
}",
);
assert!(r.is_ok());
}