Skip to content

Commit d1d3be2

Browse files
committed
feat(tests & examples) Rust cargo
1 parent f2aefae commit d1d3be2

File tree

13 files changed

+90
-0
lines changed

13 files changed

+90
-0
lines changed

tests/examples/rust/cargo-build-and-run/Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "main"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub fn print_hello() {
2+
println!("Hello, World!");
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mod helper;
2+
3+
fn main() {
4+
helper::print_hello();
5+
}
6+

tests/examples/rust/cargo-build/Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "main"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub fn print_hello() {
2+
println!("Hello, World!");
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mod helper;
2+
3+
fn main() {
4+
helper::print_hello();
5+
}
6+

tests/examples/rust/cargo-run/Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "main"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub fn print_hello() {
2+
println!("Hello, World!");
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mod helper;
2+
3+
fn main() {
4+
helper::print_hello();
5+
}
6+

tests/tests/rust.lua

+15
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,18 @@ vim.wait(ms)
2828
vim.api.nvim_set_current_dir(example .. "solution/")
2929
language.action("option4")
3030
vim.wait(ms)
31+
32+
-- Cargo build and run
33+
vim.api.nvim_set_current_dir(example .. "cargo-build-and-run/")
34+
language.action("option5")
35+
vim.wait(ms)
36+
37+
-- Cargo build
38+
vim.api.nvim_set_current_dir(example .. "cargo-build/")
39+
language.action("option6")
40+
vim.wait(ms)
41+
42+
-- Cargo run
43+
vim.api.nvim_set_current_dir(example .. "cargo-run/")
44+
language.action("option7")
45+
vim.wait(ms)

0 commit comments

Comments
 (0)