Skip to content

Commit

Permalink
test container height
Browse files Browse the repository at this point in the history
  • Loading branch information
mertalev committed Jan 13, 2025
1 parent a875860 commit 73916b5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 132 deletions.
28 changes: 0 additions & 28 deletions pkg/justified-layout-wasm.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/justified-layout-wasm.js

This file was deleted.

93 changes: 0 additions & 93 deletions pkg/justified-layout-wasm_bg.js

This file was deleted.

Binary file removed pkg/justified-layout-wasm_bg.wasm
Binary file not shown.
7 changes: 0 additions & 7 deletions pkg/justified-layout-wasm_bg.wasm.d.ts

This file was deleted.

24 changes: 24 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ fn applies_spacing() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 904);

let max_row_height = layout[1];
assert_eq!(max_row_height, 300);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -113,6 +116,9 @@ fn expands_row_based_on_height_tolerance() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 994);

let max_row_height = layout[1];
assert_eq!(max_row_height, 330);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -157,6 +163,9 @@ fn adds_second_row_due_to_spacing() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 602);

let max_row_height = layout[1];
assert_eq!(max_row_height, 602);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -201,6 +210,9 @@ fn positions_boxes_with_different_aspect_ratios() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 771);

let max_row_height = layout[1];
assert_eq!(max_row_height, 602);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -245,6 +257,9 @@ fn scales_boxes_with_different_aspect_ratios_when_using_height_tolerance() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 900);

let max_row_height = layout[1];
assert_eq!(max_row_height, 712);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -289,6 +304,9 @@ fn one_square_box_on_each_row() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 300);

let max_row_height = layout[1];
assert_eq!(max_row_height, 904);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -333,6 +351,9 @@ fn different_shaped_boxes_on_each_row() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 600);

let max_row_height = layout[1];
assert_eq!(max_row_height, 904);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down Expand Up @@ -377,6 +398,9 @@ fn one_box_on_each_row_with_scaling() {
let max_row_width = layout[0];
assert_eq!(max_row_width, 600);

let max_row_height = layout[1];
assert_eq!(max_row_height, 337 + 2 + 300 + 2 + 345);

let [top1, left1, width1, height1] = layout[4..8] else {
unreachable!()
};
Expand Down

0 comments on commit 73916b5

Please sign in to comment.