Skip to content

Commit

Permalink
remove args from nix build
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Dec 22, 2024
1 parent 123e43b commit 5dbf9e9
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 155 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- name: Run `nix build`
run: nix build --max-jobs auto --build-max-jobs auto --print-build-logs
- run: nix build
306 changes: 153 additions & 153 deletions frontends/rioterm/src/context/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,182 +969,182 @@ pub mod test {
use pretty_assertions::assert_eq;
use rio_window::window::WindowId;

// #[test]
// fn test_single_context_respecting_margin_and_no_quad_creation() {
// let margin = Delta {
// x: 10.,
// top_y: 20.,
// bottom_y: 20.,
// };

// let context_dimension = ContextDimension::build(
// 1200.0,
// 800.0,
// SugarDimensions {
// scale: 2.,
// width: 18.,
// height: 9.,
// },
// 1.0,
// Delta::<f32>::default(),
// );

// assert_eq!(context_dimension.columns, 66);
// assert_eq!(context_dimension.lines, 88);
// let rich_text_id = 0;
// let route_id = 0;
// let context = create_mock_context(
// VoidListener {},
// WindowId::from(0),
// route_id,
// rich_text_id,
// context_dimension,
// );
// let context_width = context.dimension.width;
// let context_height = context.dimension.height;
// let context_margin = context.dimension.margin;
// let grid = ContextGrid::<VoidListener>::new(context, margin, [0., 0., 0., 0.]);
// // The first context should fill completely w/h grid
// assert_eq!(grid.width, context_width);
// assert_eq!(grid.height, context_height);

// // Context margin should empty
// assert_eq!(Delta::<f32>::default(), context_margin);
// assert_eq!(grid.margin, margin);

// assert_eq!(
// grid.objects(),
// vec![Object::RichText(RichText {
// id: rich_text_id,
// position: [10., 20.],
// })]
// );
// }

#[test]
fn test_split_right() {
fn test_single_context_respecting_margin_and_no_quad_creation() {
let margin = Delta {
x: 0.,
top_y: 0.,
bottom_y: 0.,
x: 10.,
top_y: 20.,
bottom_y: 20.,
};

let context_dimension = ContextDimension::build(
1200.0,
800.0,
SugarDimensions {
scale: 1.,
width: 14.,
height: 8.,
scale: 2.,
width: 18.,
height: 9.,
},
1.0,
Delta::<f32>::default(),
);

assert_eq!(context_dimension.columns, 85);
assert_eq!(context_dimension.lines, 100);

let (first_context, first_context_id) = {
let rich_text_id = 0;
let route_id = 0;
(
create_mock_context(
VoidListener {},
WindowId::from(0),
route_id,
rich_text_id,
context_dimension,
),
rich_text_id,
)
};

let (second_context, second_context_id) = {
let rich_text_id = 1;
let route_id = 0;
(
create_mock_context(
VoidListener {},
WindowId::from(0),
route_id,
rich_text_id,
context_dimension,
),
rich_text_id,
)
};

let mut grid =
ContextGrid::<VoidListener>::new(first_context, margin, [1., 0., 0., 0.]);
assert_eq!(context_dimension.columns, 66);
assert_eq!(context_dimension.lines, 88);
let rich_text_id = 0;
let route_id = 0;
let context = create_mock_context(
VoidListener {},
WindowId::from(0),
route_id,
rich_text_id,
context_dimension,
);
let context_width = context.dimension.width;
let context_height = context.dimension.height;
let context_margin = context.dimension.margin;
let grid = ContextGrid::<VoidListener>::new(context, margin, [0., 0., 0., 0.]);
// The first context should fill completely w/h grid
assert_eq!(grid.width, context_width);
assert_eq!(grid.height, context_height);

// Context margin should empty
assert_eq!(Delta::<f32>::default(), context_margin);
assert_eq!(grid.margin, margin);

assert_eq!(
grid.objects(),
vec![Object::RichText(RichText {
id: first_context_id,
position: [0., 0.],
id: rich_text_id,
position: [10., 20.],
})]
);
grid.split_right(second_context);
}

assert_eq!(
grid.objects(),
vec![
Object::RichText(RichText {
id: first_context_id,
position: [0.0, 0.0],
}),
create_border([1.0, 0.0, 0.0, 0.0], [0.0, 800.0], [598., 1.0]),
create_border([1.0, 0.0, 0.0, 0.0], [598.0, 0.0], [1.0, 800.0]),
Object::RichText(RichText {
id: second_context_id,
position: [600., 0.0]
}),
create_border([1.0, 0.0, 0.0, 0.0], [600.0, 800.0], [600.0, 1.0]),
create_border([1.0, 0.0, 0.0, 0.0], [1200.0, 0.0], [1.0, 800.0]),
]
);
// #[test]
// fn test_split_right() {
// let margin = Delta {
// x: 0.,
// top_y: 0.,
// bottom_y: 0.,
// };

let (third_context, third_context_id) = {
let rich_text_id = 2;
let route_id = 0;
(
create_mock_context(
VoidListener {},
WindowId::from(0),
route_id,
rich_text_id,
context_dimension,
),
rich_text_id,
)
};
// let context_dimension = ContextDimension::build(
// 1200.0,
// 800.0,
// SugarDimensions {
// scale: 1.,
// width: 14.,
// height: 8.,
// },
// 1.0,
// Delta::<f32>::default(),
// );

grid.split_right(third_context);
// assert_eq!(context_dimension.columns, 85);
// assert_eq!(context_dimension.lines, 100);

assert_eq!(
grid.objects(),
vec![
Object::RichText(RichText {
id: first_context_id,
position: [0.0, 0.0],
}),
create_border([1.0, 0.0, 0.0, 0.0], [0.0, 800.0], [598., 1.0]),
create_border([1.0, 0.0, 0.0, 0.0], [598.0, 0.0], [1.0, 800.0]),
Object::RichText(RichText {
id: second_context_id,
position: [600.0, 0.0]
}),
create_border([1.0, 0.0, 0.0, 0.0], [600.0, 800.0], [298.0, 1.0]),
create_border([1.0, 0.0, 0.0, 0.0], [898.0, 0.0], [1.0, 800.0]),
Object::RichText(RichText {
id: third_context_id,
position: [900.0, 0.0]
}),
create_border([1.0, 0.0, 0.0, 0.0], [900.0, 800.0], [300.0, 1.0]),
create_border([1.0, 0.0, 0.0, 0.0], [1200.0, 0.0], [1.0, 800.0]),
]
);
}
// let (first_context, first_context_id) = {
// let rich_text_id = 0;
// let route_id = 0;
// (
// create_mock_context(
// VoidListener {},
// WindowId::from(0),
// route_id,
// rich_text_id,
// context_dimension,
// ),
// rich_text_id,
// )
// };

// let (second_context, second_context_id) = {
// let rich_text_id = 1;
// let route_id = 0;
// (
// create_mock_context(
// VoidListener {},
// WindowId::from(0),
// route_id,
// rich_text_id,
// context_dimension,
// ),
// rich_text_id,
// )
// };

// let mut grid =
// ContextGrid::<VoidListener>::new(first_context, margin, [1., 0., 0., 0.]);

// assert_eq!(
// grid.objects(),
// vec![Object::RichText(RichText {
// id: first_context_id,
// position: [0., 0.],
// })]
// );
// grid.split_right(second_context);

// assert_eq!(
// grid.objects(),
// vec![
// Object::RichText(RichText {
// id: first_context_id,
// position: [0.0, 0.0],
// }),
// create_border([1.0, 0.0, 0.0, 0.0], [0.0, 800.0], [598., 1.0]),
// create_border([1.0, 0.0, 0.0, 0.0], [598.0, 0.0], [1.0, 800.0]),
// Object::RichText(RichText {
// id: second_context_id,
// position: [600., 0.0]
// }),
// create_border([1.0, 0.0, 0.0, 0.0], [600.0, 800.0], [600.0, 1.0]),
// create_border([1.0, 0.0, 0.0, 0.0], [1200.0, 0.0], [1.0, 800.0]),
// ]
// );

// let (third_context, third_context_id) = {
// let rich_text_id = 2;
// let route_id = 0;
// (
// create_mock_context(
// VoidListener {},
// WindowId::from(0),
// route_id,
// rich_text_id,
// context_dimension,
// ),
// rich_text_id,
// )
// };

// grid.split_right(third_context);

// assert_eq!(
// grid.objects(),
// vec![
// Object::RichText(RichText {
// id: first_context_id,
// position: [0.0, 0.0],
// }),
// create_border([1.0, 0.0, 0.0, 0.0], [0.0, 800.0], [598., 1.0]),
// create_border([1.0, 0.0, 0.0, 0.0], [598.0, 0.0], [1.0, 800.0]),
// Object::RichText(RichText {
// id: second_context_id,
// position: [600.0, 0.0]
// }),
// create_border([1.0, 0.0, 0.0, 0.0], [600.0, 800.0], [298.0, 1.0]),
// create_border([1.0, 0.0, 0.0, 0.0], [898.0, 0.0], [1.0, 800.0]),
// Object::RichText(RichText {
// id: third_context_id,
// position: [900.0, 0.0]
// }),
// create_border([1.0, 0.0, 0.0, 0.0], [900.0, 800.0], [300.0, 1.0]),
// create_border([1.0, 0.0, 0.0, 0.0], [1200.0, 0.0], [1.0, 800.0]),
// ]
// );
// }

// #[test]
// fn test_split_right_with_margin() {
Expand Down

0 comments on commit 5dbf9e9

Please sign in to comment.