1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use crate::{
  io::IO,
  ui::UILock,
  buffer::iters::LinesIter,
};

use super::Result;

/// An [`IO`] implementation for when no IO should occur. Intended for non IO
/// tests.
pub struct DummyIO {}
impl DummyIO {
  pub fn new() -> Self { Self{} }
}

impl IO for DummyIO {
  fn run_command(&mut self,
    _ui: &mut UILock,
    _command: String,
  ) -> Result<()> {
    unimplemented!()
  }
  fn run_read_command(&mut self,
    _ui: &mut UILock,
    _command: String,
  ) -> Result<String> {
    unimplemented!()
  }
  fn run_write_command(&mut self,
    _ui: &mut UILock,
    _command: String,
    _input: LinesIter,
  ) -> Result<usize> {
    unimplemented!()
  }
  fn run_transform_command(&mut self,
    _ui: &mut UILock,
    _command: String,
    _input: LinesIter,
  ) -> Result<String> {
    unimplemented!()
  }
  fn write_file(&mut self,
    _path: &str,
    _append: bool,
    _data: LinesIter,
  ) -> Result<usize> {
    unimplemented!()
  }
  fn read_file(&mut self,
    _path: &str,
    _must_exist: bool,
  ) -> Result<String> {
    unimplemented!()
  }
}