Skip to content

Commit

Permalink
tests: test outout 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 72b9bf3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/src/api/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::PathBuf;

use all_asserts::*;
use nvim_oxi as oxi;
use nvim_oxi::api::{self, opts::*, types::*, Buffer};
Expand Down Expand Up @@ -211,3 +213,15 @@ 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();

assert_eq!(term_name_oxi, PathBuf::from(term_name_lua));
}

0 comments on commit 72b9bf3

Please sign in to comment.