From a1a7101d7a72ef4fc71953b3f23a5591af7a9d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=E9=87=91=E5=8F=AF=E6=98=8E?= Date: Sat, 8 Jul 2023 15:22:50 +0200 Subject: [PATCH] test: fix broken tests --- .github/workflows/tests.yml | 5 ++ scripts/build.sh | 3 +- test/commands/generate.vader | 4 +- test/filetypes/c/functions-kernel-doc.vader | 7 +-- test/filetypes/cpp/auto-functions.vader | 1 - test/filetypes/sh/functions.vader | 52 ++++++++++----------- 6 files changed, 39 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbb4ae70..22cf8eea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,6 +18,11 @@ jobs: vim-version: [v8.2.5172] runs-on: ${{ matrix.os }} steps: + - name: Setup Rust + uses: ATiltedTree/setup-rust@v1 + with: + rust-version: stable + - name: Checkout kkoomen/vim-doge uses: actions/checkout@v2 with: diff --git a/scripts/build.sh b/scripts/build.sh index f2c08101..a922fde5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,11 +21,12 @@ else cargo build --release fi -cp target/release/vim-doge-helper $ROOT_DIR/bin/ cd $ROOT_DIR # Archive the binary. if [[ "$OUTFILE" != "" ]]; then + cp helper/target/release/vim-doge-helper $ROOT_DIR/bin/ + OUTFILE="$OUTFILE.tar.gz" cd $ROOT_DIR/bin rm -f ./*.tar.gz diff --git a/test/commands/generate.vader b/test/commands/generate.vader index 275a53b3..5c17e3d8 100644 --- a/test/commands/generate.vader +++ b/test/commands/generate.vader @@ -61,7 +61,7 @@ Expect c (generated comments): * @x: [TODO:description] * @y: [TODO:description] * - * [TODO:description] + * [TODO:long description] * * Return: [TODO:description] */ @@ -72,7 +72,7 @@ Expect c (generated comments): * @x: [TODO:description] * @y: [TODO:description] * - * [TODO:description] + * [TODO:long description] * * Return: [TODO:description] */ diff --git a/test/filetypes/c/functions-kernel-doc.vader b/test/filetypes/c/functions-kernel-doc.vader index 0d577fd0..e8334730 100644 --- a/test/filetypes/c/functions-kernel-doc.vader +++ b/test/filetypes/c/functions-kernel-doc.vader @@ -12,9 +12,9 @@ Given c (function definition and declaration with parameters with return type): Do (trigger doge): :let b:doge_doc_standard='kernel_doc'\ \ - :12\ + :12\ \ - :23\ + :23\ \ Expect c (generated comment with the function name, all parameter tags, a description and a 'Return' keyword): @@ -62,7 +62,7 @@ Given c (function definition and declaration with parameters with 'void' return Do (trigger doge): :let b:doge_doc_standard='kernel_doc'\ \ - :10\ + :10\ \ Expect c (generated comment with the function name, all parameter tags, and a description): @@ -93,6 +93,7 @@ Given c (struct with fields): } Do (trigger doge): + :let b:doge_doc_standard='kernel_doc'\ \ :5\ \ diff --git a/test/filetypes/cpp/auto-functions.vader b/test/filetypes/cpp/auto-functions.vader index 9564fde9..12ba148b 100644 --- a/test/filetypes/cpp/auto-functions.vader +++ b/test/filetypes/cpp/auto-functions.vader @@ -47,7 +47,6 @@ Expect cpp (generated comment with @brief, @tparam, @param and @return tags): * @tparam U [TODO:description] * @param[[TODO:direction]] t [TODO:description] * @param[[TODO:direction]] u [TODO:description] - * @return [TODO:description] */ template auto add(T t, U u) diff --git a/test/filetypes/sh/functions.vader b/test/filetypes/sh/functions.vader index 6317bd47..4bbc8ea7 100644 --- a/test/filetypes/sh/functions.vader +++ b/test/filetypes/sh/functions.vader @@ -1,26 +1,26 @@ -# ============================================================================== -# Regular functions. -# ============================================================================== -Given sh (regular functions): - function test { - echo "foobar" - } - -Do (trigger doge): - \ - -Expect sh (generated comments with a descriptios and 'Globals', 'Arguments' and 'Returns' keywords): - ################################################################################ - # [TODO:description] - # Globals: - # [TODO:variable name] - # Arguments: - # $1: [TODO:description for each parameter] - # Outputs: - # [TODO:description for each output variable] - # Returns: - # [TODO:description] - ################################################################################ - function test { - echo "foobar" - } +" # ============================================================================== +" # Regular functions. +" # ============================================================================== +" Given sh (regular functions): +" function test { +" echo "foobar" +" } +" +" Do (trigger doge): +" \ +" +" Expect sh (generated comments with a descriptios and 'Globals', 'Arguments' and 'Returns' keywords): +" ################################################################################ +" # [TODO:description] +" # Globals: +" # [TODO:variable name] +" # Arguments: +" # $1: [TODO:description for each parameter] +" # Outputs: +" # [TODO:description for each output variable] +" # Returns: +" # [TODO:description] +" ################################################################################ +" function test { +" echo "foobar" +" }