1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Fix failing tests

This commit is contained in:
Christian Duerr 2018-11-08 00:03:11 +01:00
parent 1e80a2e757
commit 9afd143850
No known key found for this signature in database
GPG key ID: 85CDAE3C164BA7B4
4 changed files with 19 additions and 17 deletions

View file

@ -908,7 +908,7 @@ mod tests {
dpr: 1.0, dpr: 1.0,
}; };
let mut terminal = Term::new(&config, size); let mut terminal = Term::new(&config, size, None);
let mut mouse = Mouse::default(); let mut mouse = Mouse::default();
mouse.click_state = $initial_state; mouse.click_state = $initial_state;

View file

@ -138,7 +138,7 @@ fn run(
// This object contains all of the state about what's being displayed. It's // This object contains all of the state about what's being displayed. It's
// wrapped in a clonable mutex since both the I/O loop and display need to // wrapped in a clonable mutex since both the I/O loop and display need to
// access it. // access it.
let terminal = Term::new(&config, display.size().to_owned(), logger_proxy); let terminal = Term::new(&config, display.size().to_owned(), Some(logger_proxy));
let terminal = Arc::new(FairMutex::new(terminal)); let terminal = Arc::new(FairMutex::new(terminal));
// Find the window ID for setting $WINDOWID // Find the window ID for setting $WINDOWID

View file

@ -813,7 +813,7 @@ pub struct Term {
auto_scroll: bool, auto_scroll: bool,
/// Proxy object for clearing displayed errors and warnings /// Proxy object for clearing displayed errors and warnings
logger_proxy: LoggerProxy, logger_proxy: Option<LoggerProxy>,
} }
/// Terminal size info /// Terminal size info
@ -896,7 +896,7 @@ impl Term {
self.next_mouse_cursor.take() self.next_mouse_cursor.take()
} }
pub fn new(config: &Config, size: SizeInfo, logger_proxy: LoggerProxy) -> Term { pub fn new(config: &Config, size: SizeInfo, logger_proxy: Option<LoggerProxy>) -> Term {
let num_cols = size.cols(); let num_cols = size.cols();
let num_lines = size.lines(); let num_lines = size.lines();
@ -1828,7 +1828,9 @@ impl ansi::Handler for Term {
}, },
ansi::ClearMode::All => { ansi::ClearMode::All => {
// Clear displayed errors and warnings // Clear displayed errors and warnings
self.logger_proxy.clear(); if let Some(ref mut logger_proxy) = self.logger_proxy {
logger_proxy.clear();
}
self.grid.region_mut(..).each(|c| c.reset(&template)); self.grid.region_mut(..).each(|c| c.reset(&template));
}, },
@ -2079,7 +2081,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(3), Column(5), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(3), Column(5), 0, Cell::default());
for i in 0..5 { for i in 0..5 {
for j in 0..2 { for j in 0..2 {
@ -2123,7 +2125,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(5), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(1), Column(5), 0, Cell::default());
for i in 0..5 { for i in 0..5 {
grid[Line(0)][Column(i)].c = 'a'; grid[Line(0)][Column(i)].c = 'a';
@ -2149,7 +2151,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(3), Column(3), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(3), Column(3), 0, Cell::default());
for l in 0..3 { for l in 0..3 {
if l != 1 { if l != 1 {
@ -2194,7 +2196,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let cursor = Point::new(Line(0), Column(0)); let cursor = Point::new(Line(0), Column(0));
term.configure_charset(CharsetIndex::G0, term.configure_charset(CharsetIndex::G0,
StandardCharset::SpecialCharacterAndLineDrawing); StandardCharset::SpecialCharacterAndLineDrawing);
@ -2214,7 +2216,7 @@ mod tests {
dpr: 1.0, dpr: 1.0,
}; };
let config: Config = Default::default(); let config: Config = Default::default();
let mut term: Term = Term::new(&config, size); let mut term: Term = Term::new(&config, size, None);
term.change_font_size(font_size); term.change_font_size(font_size);
let expected_font_size: Size = config.font().size() + Size::new(font_size); let expected_font_size: Size = config.font().size() + Size::new(font_size);
@ -2243,7 +2245,7 @@ mod tests {
dpr: 1.0, dpr: 1.0,
}; };
let config: Config = Default::default(); let config: Config = Default::default();
let mut term: Term = Term::new(&config, size); let mut term: Term = Term::new(&config, size, None);
term.change_font_size(-100.0); term.change_font_size(-100.0);
@ -2263,7 +2265,7 @@ mod tests {
dpr: 1.0, dpr: 1.0,
}; };
let config: Config = Default::default(); let config: Config = Default::default();
let mut term: Term = Term::new(&config, size); let mut term: Term = Term::new(&config, size, None);
term.change_font_size(10.0); term.change_font_size(10.0);
term.reset_font_size(); term.reset_font_size();
@ -2284,7 +2286,7 @@ mod tests {
dpr: 1.0 dpr: 1.0
}; };
let config: Config = Default::default(); let config: Config = Default::default();
let mut term: Term = Term::new(&config, size); let mut term: Term = Term::new(&config, size, None);
// Add one line of scrollback // Add one line of scrollback
term.grid.scroll_up(&(Line(0)..Line(1)), Line(1), &Cell::default()); term.grid.scroll_up(&(Line(0)..Line(1)), Line(1), &Cell::default());
@ -2310,7 +2312,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());
grid[Line(0)][Column(0)].c = '('; grid[Line(0)][Column(0)].c = '(';
grid[Line(0)][Column(1)].c = '('; grid[Line(0)][Column(1)].c = '(';
@ -2346,7 +2348,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());
grid[Line(0)][Column(0)].c = 'f'; grid[Line(0)][Column(0)].c = 'f';
grid[Line(0)][Column(1)].c = 't'; grid[Line(0)][Column(1)].c = 't';
@ -2381,7 +2383,7 @@ mod tests {
padding_y: 0.0, padding_y: 0.0,
dpr: 1.0, dpr: 1.0,
}; };
let mut term = Term::new(&Default::default(), size); let mut term = Term::new(&Default::default(), size, None);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default()); let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());
grid[Line(0)][Column(0)].c = 'a'; grid[Line(0)][Column(0)].c = 'a';
grid[Line(0)][Column(1)].c = 'z'; grid[Line(0)][Column(1)].c = 'z';

View file

@ -90,7 +90,7 @@ fn ref_test(dir: &Path) {
let mut config: Config = Default::default(); let mut config: Config = Default::default();
config.set_history(ref_config.history_size); config.set_history(ref_config.history_size);
let mut terminal = Term::new(&config, size); let mut terminal = Term::new(&config, size, None);
let mut parser = ansi::Processor::new(); let mut parser = ansi::Processor::new();
for byte in recording { for byte in recording {