MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / test_heterogeneous_compare

Function test_heterogeneous_compare

cel/src/objects.rs:1820–1838  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1818
1819 #[test]
1820 fn test_heterogeneous_compare() {
1821 let context = Context::default();
1822
1823 let program = Program::compile("1 < uint(2)").unwrap();
1824 let value = program.execute(&context).unwrap();
1825 assert_eq!(value, true.into());
1826
1827 let program = Program::compile("1 < 1.1").unwrap();
1828 let value = program.execute(&context).unwrap();
1829 assert_eq!(value, true.into());
1830
1831 let program = Program::compile("uint(0) > -10").unwrap();
1832 let value = program.execute(&context).unwrap();
1833 assert_eq!(
1834 value,
1835 true.into(),
1836 "negative signed ints should be less than uints"
1837 );
1838 }
1839
1840 #[test]
1841 fn test_float_compare() {

Callers

nothing calls this directly

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected