question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Go] "go test" does not pass

See original GitHub issue

This seems to be a problem with some code that wasn’t updated with ATN serialization/deserialization.

Unfortunately, I don’t think the tests are performed in CI builds. cd runtime/Go/antlr4; go test. Honestly, these Go-specific tests probably should not even go here, but it is what it is, and I’m continuing the tradition.

ken@DESKTOP-DL44R7B:/mnt/c/msys64/home/Kenne/current/antlr4/runtime/Go/antlr$ go test
panic: Could not deserialize ATN with version 3 (expected 4).

goroutine 1 [running]:
github.com/antlr/antlr4/runtime/Go/antlr.(*ATNDeserializer).checkVersion(0x678980)
	/mnt/c/msys64/home/Kenne/current/antlr4/runtime/Go/antlr/atn_deserializer.go:87 +0xdd
github.com/antlr/antlr4/runtime/Go/antlr.(*ATNDeserializer).DeserializeFromUInt16(0xc00011a2a0, {0x678980, 0x7fffffff, 0x10})
	/mnt/c/msys64/home/Kenne/current/antlr4/runtime/Go/antlr/atn_deserializer.go:52 +0x7d
github.com/antlr/antlr4/runtime/Go/antlr.init()
	/mnt/c/msys64/home/Kenne/current/antlr4/runtime/Go/antlr/testing_lexer_b_test.go:44 +0x672
exit status 2
FAIL    github.com/antlr/antlr4/runtime/Go/antlr        0.005s

I’ll fix the code. Blocked on another Go PR because of this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jimidlecommented, Aug 23, 2022

The go.mod file is updated and go.sum is now included in the repo, as it should be.

I think that the pure go runtime tests will be useful, but they are not very substantial as they stand. they do not have to reside in the main package, they can be in a test package.

0reactions
jimidlecommented, Sep 12, 2022

@parrt This can be closed now. The go test does pass, even if the tests don’t really do that much and probably should be expanded greatly.

Go pretty much requires that _test versions of a source reside along side the source they are testing. We could make external tests work, but that would not be the go ‘way’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Go: Test cannot pass? - Stack Overflow
I'm having a problem making this test pass. The problem is, the Write() method in my struct needs to write to a property,...
Read more >
Testing in Go: Failing Tests - Ilija Eftimov ‍
Golang's testing package promotes two types of failures. The first failure type immediately stops the tests from running. And the second failure ...
Read more >
Testing - Go by Example
Unit testing is an important part of writing principled Go programs. The testing package provides the tools we need to write unit tests...
Read more >
Go Test | GoLand Documentation - JetBrains
With the Go Test configuration, you can run and debug Go applications. For more information about running tests, see the following topics:.
Read more >
testing - Go Packages
Tests or benchmarks may be skipped at run time with a call to the Skip method of *T or *B: func TestTimeConsuming(t *testing.T)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found