mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Fix tests and clippy warnings
This commit is contained in:
parent
9d42de6c7c
commit
078f91b162
2 changed files with 21 additions and 18 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
//! Tests for the Gird
|
||||
|
||||
use super::{Grid, BidirectionalIterator};
|
||||
use super::{Grid};
|
||||
use index::{Point, Line, Column};
|
||||
|
||||
// Scroll up moves lines upwards
|
||||
|
@ -112,7 +112,7 @@ fn test_iter() {
|
|||
col: Column(0),
|
||||
});
|
||||
|
||||
assert_eq!(None, iter.prev());
|
||||
assert_eq!(None, iter.next_back());
|
||||
assert_eq!(Some(&1), iter.next());
|
||||
assert_eq!(Column(1), iter.cur.col);
|
||||
assert_eq!(4, iter.cur.line);
|
||||
|
@ -126,7 +126,7 @@ fn test_iter() {
|
|||
assert_eq!(Column(0), iter.cur.col);
|
||||
assert_eq!(3, iter.cur.line);
|
||||
|
||||
assert_eq!(Some(&4), iter.prev());
|
||||
assert_eq!(Some(&4), iter.next_back());
|
||||
assert_eq!(Column(4), iter.cur.col);
|
||||
assert_eq!(4, iter.cur.line);
|
||||
|
||||
|
@ -137,5 +137,5 @@ fn test_iter() {
|
|||
col: Column(4),
|
||||
});
|
||||
assert_eq!(None, final_iter.next());
|
||||
assert_eq!(Some(&23), final_iter.prev());
|
||||
assert_eq!(Some(&23), final_iter.next_back());
|
||||
}
|
||||
|
|
15
src/input.rs
15
src/input.rs
|
@ -488,9 +488,9 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
|||
} else {
|
||||
// Spawn URL launcher when clicking on URLs
|
||||
let moved = self.ctx.mouse().last_press_pos != (self.ctx.mouse().x, self.ctx.mouse().y);
|
||||
let ref url_launcher = self.mouse_config.url_launcher;
|
||||
match (self.ctx.mouse_coords(), url_launcher, moved) {
|
||||
(Some(point), Some(launcher), false) => {
|
||||
if let (Some(point), Some(launcher), false) =
|
||||
(self.ctx.mouse_coords(), &self.mouse_config.url_launcher, moved)
|
||||
{
|
||||
if let Some(text) = self.ctx.url(Point::new(point.line.0, point.col)) {
|
||||
let mut args = launcher.args().to_vec();
|
||||
args.push(text);
|
||||
|
@ -501,8 +501,6 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
|||
.expect("url launcher error");
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
if self.save_to_clipboard {
|
||||
|
@ -798,6 +796,10 @@ mod tests {
|
|||
self.mouse
|
||||
}
|
||||
|
||||
fn url(&self, _: Point<usize>) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn received_count(&mut self) -> &mut usize {
|
||||
&mut self.received_count
|
||||
}
|
||||
|
@ -866,11 +868,12 @@ mod tests {
|
|||
threshold: Duration::from_millis(1000),
|
||||
},
|
||||
faux_scrollback_lines: None,
|
||||
url_launcher: None,
|
||||
},
|
||||
scrolling_config: &config::Scrolling::default(),
|
||||
key_bindings: &config.key_bindings()[..],
|
||||
mouse_bindings: &config.mouse_bindings()[..],
|
||||
save_to_clipboard: config.selection().save_to_clipboard
|
||||
save_to_clipboard: config.selection().save_to_clipboard,
|
||||
};
|
||||
|
||||
if let Event::WindowEvent { event: WindowEvent::MouseInput { state, button, modifiers, .. }, .. } = $input {
|
||||
|
|
Loading…
Reference in a new issue