Skip to content

Commit

Permalink
tests: test output of Buffer::get_name() on terminal buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Oct 11, 2023
1 parent e4cabf2 commit 6124b57
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/src/api/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,18 @@ fn buf_set_get_option() {
buf.set_option("modified", false).unwrap();
assert!(!buf.get_option::<bool>("modified").unwrap());
}

#[oxi::test]
fn buf_terminal_name() {
api::command("term").unwrap();

let term_name_oxi = Buffer::current().get_name().unwrap();

let term_name_lua =
api::exec("lua =vim.api.nvim_buf_get_name(0)", true).unwrap().unwrap();

#[cfg(feature = "neovim-0-8")]
let term_name_lua = term_name_lua.trim_matches('"').to_owned();

assert_eq!(term_name_oxi.display().to_string(), term_name_lua);
}

0 comments on commit 6124b57

Please sign in to comment.