MCPcopy Create free account
hub / github.com/apache/datafusion / test_hex_int64

Function test_hex_int64

datafusion/spark/src/function/math/hex.rs:459–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

457
458 #[test]
459 fn test_hex_int64() {
460 let test_cases = vec![
461 (0_i64, "0"),
462 (1, "1"),
463 (15, "F"),
464 (16, "10"),
465 (255, "FF"),
466 (256, "100"),
467 (1234, "4D2"),
468 (i64::MAX, "7FFFFFFFFFFFFFFF"),
469 (i64::MIN, "8000000000000000"),
470 (-1, "FFFFFFFFFFFFFFFF"),
471 ];
472
473 for (num, expected) in test_cases {
474 let mut cache = [0u8; 16];
475 let slice = super::hex_int64(num, &mut cache);
476
477 unsafe {
478 let result = from_utf8_unchecked(slice);
479 assert_eq!(expected, result, "hex_int64({num}) mismatch");
480 }
481 }
482 }
483
484 #[test]
485 fn test_hex_lookup_table_covers_all_bytes() {

Callers

nothing calls this directly

Calls 1

hex_int64Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…