MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_cint

Function test_cint

std/src/numerics.rs:1234–1250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1232
1233 #[test]
1234 fn test_cint() {
1235 check_expr_ok(0, "CINT(0.1)");
1236 check_expr_ok(0, "CINT(-0.1)");
1237 check_expr_ok(1, "CINT(0.9)");
1238 check_expr_ok(-1, "CINT(-0.9)");
1239
1240 check_expr_ok_with_vars(1, "CINT(d)", [("d", 0.9f64.into())]);
1241
1242 check_expr_compilation_error("1:10: CINT expected expr#", "CINT()");
1243 check_expr_compilation_error("1:15: BOOLEAN is not a number", "CINT(FALSE)");
1244 check_expr_compilation_error("1:10: CINT expected expr#", "CINT(3.0, 4)");
1245
1246 check_expr_error(
1247 "1:15: Cannot cast -1234567890123456 to integer due to overflow",
1248 "CINT(-1234567890123456.0)",
1249 );
1250 }
1251
1252 #[test]
1253 fn test_cos() {

Callers

nothing calls this directly

Calls 4

check_expr_okFunction · 0.85
check_expr_ok_with_varsFunction · 0.85
check_expr_errorFunction · 0.85

Tested by

no test coverage detected