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

Function test_int

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

Source from the content-addressed store, hash-verified

1322
1323 #[test]
1324 fn test_int() {
1325 check_expr_ok(0, "INT(0.1)");
1326 check_expr_ok(-1, "INT(-0.1)");
1327 check_expr_ok(0, "INT(0.9)");
1328 check_expr_ok(-1, "INT(-0.9)");
1329
1330 check_expr_ok_with_vars(0, "INT(d)", [("d", 0.9f64.into())]);
1331
1332 check_expr_compilation_error("1:10: INT expected expr#", "INT()");
1333 check_expr_compilation_error("1:14: BOOLEAN is not a number", "INT(FALSE)");
1334 check_expr_compilation_error("1:10: INT expected expr#", "INT(3.0, 4)");
1335
1336 check_expr_error(
1337 "1:14: Cannot cast -1234567890123456 to integer due to overflow",
1338 "INT(-1234567890123456.0)",
1339 );
1340 }
1341
1342 #[test]
1343 fn test_log() {

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