()
| 734 | |
| 735 | #[test] |
| 736 | fn raw_variable_extraction() { |
| 737 | let schema = StrictSchema::new(vec![ |
| 738 | ColumnDef::required("id", ColumnType::Int64), |
| 739 | ColumnDef::required("name", ColumnType::String), |
| 740 | ColumnDef::nullable("bio", ColumnType::String), |
| 741 | ]) |
| 742 | .unwrap(); |
| 743 | let encoder = TupleEncoder::new(&schema); |
| 744 | let decoder = TupleDecoder::new(&schema); |
| 745 | |
| 746 | let tuple = encoder |
| 747 | .encode(&[ |
| 748 | Value::Integer(1), |
| 749 | Value::String("hello".into()), |
| 750 | Value::String("world".into()), |
| 751 | ]) |
| 752 | .unwrap(); |
| 753 | |
| 754 | let name_raw = decoder.extract_variable_raw(&tuple, 1).unwrap().unwrap(); |
| 755 | assert_eq!(std::str::from_utf8(name_raw).unwrap(), "hello"); |
| 756 | |
| 757 | let bio_raw = decoder.extract_variable_raw(&tuple, 2).unwrap().unwrap(); |
| 758 | assert_eq!(std::str::from_utf8(bio_raw).unwrap(), "world"); |
| 759 | } |
| 760 | |
| 761 | #[test] |
| 762 | fn all_types_roundtrip() { |
nothing calls this directly
no test coverage detected