Skip to content

Commit 0a34651

Browse files
committed
test: make box ordering test explicit
1 parent c2f652f commit 0a34651

File tree

1 file changed

+22
-0
lines changed
  • sqlx-postgres/src/types/geometry

1 file changed

+22
-0
lines changed

sqlx-postgres/src/types/geometry/box.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,26 @@ mod box_tests {
254254
};
255255
assert_eq!(pg_box.serialize_to_vec(), BOX_BYTES,)
256256
}
257+
258+
#[test]
259+
fn can_order_box() {
260+
let pg_box = PgBox {
261+
x1: -2.,
262+
x2: 2.,
263+
y1: 2.,
264+
y2: -2.,
265+
};
266+
let bytes = pg_box.serialize_to_vec();
267+
268+
let pg_box = PgBox::from_bytes(&bytes).unwrap();
269+
assert_eq!(
270+
pg_box,
271+
PgBox {
272+
x1: 2.,
273+
y1: 2.,
274+
x2: -2.,
275+
y2: -2.
276+
}
277+
)
278+
}
257279
}

0 commit comments

Comments
 (0)