Giter VIP home page Giter VIP logo

Comments (3)

nlamirault avatar nlamirault commented on July 1, 2024

With last version, i've got this output when i run go-test-current-file with the cursor inside ExampleB

package main

import (
    "fmt"
    "testing"
)

func TestA(t *testing.T) {
    fmt.Println("test a")
}

func TestAB(t *testing.T) {
    fmt.Println("test ab")
}

func ExampleB() {
    fmt.Println("Example")
        // Output: Example
}

func BenchmarkHello(b *testing.B) {
    for i := 0; i < b.N; i++ {
        fmt.Sprintf("hello")
    }
}
$ go test -run='TestA|TestAB|ExampleB'
test a
test ab
PASS
ok      _/home/nlamirault/gotest.el/var 0.002s

in a shell :

go test -v -run='TestA|TestAB|ExampleA'
=== RUN   TestA
test a
--- PASS: TestA (0.00s)
=== RUN   TestAB
test ab
--- PASS: TestAB (0.00s)
=== RUN   ExampleA
--- PASS: ExampleA (0.00s)
PASS
ok      _/home/nlamirault/Perso/gotest.el/var   0.002s

With -u argument (using C-u M-x go-test-current-file) :

go test -v -run='TestA|TestAB|ExampleA'
=== RUN   TestA
test a
--- PASS: TestA (0.00s)
=== RUN   TestAB
test ab
--- PASS: TestAB (0.00s)
=== RUN   ExampleA
--- PASS: ExampleA (0.00s)
PASS
ok      _/home/nlamirault/Perso/gotest.el/var   0.004s

from gotest.el.

kostya-sh avatar kostya-sh commented on July 1, 2024

Sorry, I meant go-test-current-test function, not go-test-current-file. The title of the issue is correct, but the body mentioned wrong function.

from gotest.el.

kostya-sh avatar kostya-sh commented on July 1, 2024

Also I am not sure if go-test-current-file should run benchmarks. A separate function would be more usable as benchmarks usually long running.

from gotest.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.