File: integer_convert_to_value.rs

package info (click to toggle)
rust-magnus 0.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,756 kB
  • sloc: ruby: 150; sh: 17; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 356 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "embed")]

#[test]
fn it_converts_integers_to_value() {
    let ruby = unsafe { magnus::embed::init() };

    magnus::rb_assert!(ruby, "val == 0", val = 0u8);

    magnus::rb_assert!(ruby, "val == -1", val = -1i64);

    magnus::rb_assert!(
        ruby,
        "val == 9223372036854775807",
        val = 9223372036854775807i64
    );
}