lsts 0.6.34

Large Scale Type Systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use lsts::tlc::TLC;

#[test]
fn check_prelex() {
   let mut tlc = TLC::new();

   tlc.check(None, "type Integer = /^[0-9]+$/; 1 : Integer;").unwrap();
   tlc.check(None, "type Integer = /^[0-9]+$/; 12 : Integer;").unwrap();
   tlc.check(None, "type Integer = /^[0-9]+$/; 1.2 : Integer;").unwrap_err();
   tlc.check(None, "type Float = /^[0-9]+[.0-9]*$/; 1.2 : Float;").unwrap();
   tlc.check(None, "type Float = /^[0-9]+[.0-9]*$/; -1.2 : Float;").unwrap_err();
}