1
0
Fork 0
firefox/third_party/rust/glsl/tests/missing_zero_float.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02: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());
}