diff --git a/tests/src/api/buffer.rs b/tests/src/api/buffer.rs index fbb27fb5..5dddbd5f 100644 --- a/tests/src/api/buffer.rs +++ b/tests/src/api/buffer.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use all_asserts::*; use nvim_oxi as oxi; use nvim_oxi::api::{self, opts::*, types::*, Buffer}; @@ -211,3 +213,15 @@ fn buf_set_get_option() { buf.set_option("modified", false).unwrap(); assert!(!buf.get_option::("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)); +}