fredrikaverpil / neotest-golang

Reliable Neotest adapter for running Go tests in Neovim.
MIT License
57 stars 5 forks source link

fix: escaping of []{} brackets were missing #64

Closed fredrikaverpil closed 6 days ago

fredrikaverpil commented 6 days ago

Why?

Having a test like this would result it not being run, and skipped by neotest-golang as the output would include "no tests to run":

package main

import "testing"

// A dummy test, just to assert that Go tests can run.
func TestNames(t *testing.T) {
    t.Run("Brackets [1] (2) {3} are ok", func(t *testing.T) {
        if Add(1, 2) != 3 {
            t.Fail()
        }
    })
}
=== RUN   TestNames
--- PASS: TestNames (0.00s)
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/fredrikaverpil/neotest-golang        1.425s  coverage: 0.0% of statements [no tests to run]

What?

Escape the brackets. Now the test runs fine.