noib3/nvim-oxi

could not find `test` in `oxi`could not find `test` in `oxi`

yuki-uthman opened this issue · 1 comments

Hello!

So far api and calc example worked as expected and I think it is super coooool.
But I do not know how to make the nvim_oxi::test macro work.
I am not sure if i am asking something stupid here because I am new to rust.

use nvim_oxi::{self as oxi, api};

#[oxi::test]
fn set_get_del_var() {
    api::set_var("foo", 42).unwrap();
    assert_eq!(Ok(42), api::get_var("foo"));
    assert_eq!(Ok(()), api::del_var("foo"));
}

The compiler complains that it cannot find test under nvim_oxi.

error[E0433]: failed to resolve: could not find `test` in `oxi`
 --> tests/test.rs:4:8
  |
  | #[oxi::test]
  |        ^^^^ could not find `test` in `oxi`

Cargo.toml

[lib]
crate-type = ["cdylib"]

[dependencies.nvim-oxi]
version = "0.2.2"
features = ["neovim-0-7"]

Thank you again for your awesome work!

You gotta add it as feature in the Cargo.toml file.

nvim-oxi = { version = "0.2.2", features = [ "test" ] }

In your case, just add it to features like this:

features = [ "neovim-0-7", "test" ]

Check out the docs.