Skip to content

Commit 38205c8

Browse files
committed
add some more test coverage for constants
1 parent 9b54464 commit 38205c8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

capnpc/test/test.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,36 @@ mod tests {
11721172
assert_eq!(int8_list.get(0), 111);
11731173
assert_eq!(int8_list.get(1), -111);
11741174

1175+
let int16_list_const = test_constants::INT16_LIST_CONST;
1176+
let int16_list = int16_list_const.get().unwrap();
1177+
assert_eq!(int16_list.len(), 2);
1178+
assert_eq!(int16_list.get(0), 11111);
1179+
assert_eq!(int16_list.get(1), -11111);
1180+
1181+
let int32_list_const = test_constants::INT32_LIST_CONST;
1182+
let int32_list = int32_list_const.get().unwrap();
1183+
assert_eq!(int32_list.len(), 2);
1184+
assert_eq!(int32_list.get(0), 111111111);
1185+
assert_eq!(int32_list.get(1), -111111111);
1186+
1187+
let int64_list_const = test_constants::INT64_LIST_CONST;
1188+
let int64_list = int64_list_const.get().unwrap();
1189+
assert_eq!(int64_list.len(), 2);
1190+
assert_eq!(int64_list.get(0), 1111111111111111111);
1191+
assert_eq!(int64_list.get(1), -1111111111111111111);
1192+
1193+
let uint8_list_const = test_constants::UINT8_LIST_CONST;
1194+
let uint8_list = uint8_list_const.get().unwrap();
1195+
assert_eq!(uint8_list.len(), 2);
1196+
assert_eq!(uint8_list.get(0), 111);
1197+
assert_eq!(uint8_list.get(1), 222);
1198+
1199+
let uint16_list_const = test_constants::UINT16_LIST_CONST;
1200+
let uint16_list = uint16_list_const.get().unwrap();
1201+
assert_eq!(uint16_list.len(), 2);
1202+
assert_eq!(uint16_list.get(0), 33333);
1203+
assert_eq!(uint16_list.get(1), 44444);
1204+
11751205
// ...
11761206

11771207
let text_list_const = test_constants::TEXT_LIST_CONST;

0 commit comments

Comments
 (0)