MCPcopy Create free account
hub / github.com/TankHQ/tank / integer_from_json

Function integer_from_json

tests/value.rs:1989–2002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1987
1988 #[test]
1989 fn integer_from_json() {
1990 assert_eq!(
1991 i32::try_from_value(Value::Json(Some(serde_json::json!(42)))).unwrap(),
1992 42
1993 );
1994 assert_eq!(
1995 i32::try_from_value(Value::Json(Some(serde_json::json!("99")))).unwrap(),
1996 99
1997 );
1998 assert_eq!(
1999 i32::try_from_value(Value::Json(Some(serde_json::json!(5.0)))).unwrap(),
2000 5
2001 );
2002 }
2003
2004 #[test]
2005 fn integer_from_varchar_and_unknown() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected