forked from nats-io/nats-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Test coverage was no longer triggered due to the check for BUILD_GOOS environment variable that was removed. Removed the check. -Re-run test package with server code coverage. -Remove unused functions in test.go. -Add test for a function in test.go. -Add missing parse +OK test.
- Loading branch information
Showing
5 changed files
with
62 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2016 Apcera Inc. All rights reserved. | ||
|
||
package test | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
"testing" | ||
) | ||
|
||
type dummyLogger struct { | ||
msg string | ||
} | ||
|
||
func (d *dummyLogger) Fatalf(format string, args ...interface{}) { | ||
d.msg = fmt.Sprintf(format, args...) | ||
|
||
} | ||
func (d *dummyLogger) Errorf(format string, args ...interface{}) { | ||
} | ||
|
||
func TestStackFatal(t *testing.T) { | ||
d := &dummyLogger{} | ||
stackFatalf(d, "test stack %d", 1) | ||
if !strings.HasPrefix(d.msg, "test stack 1") { | ||
t.Fatalf("Unexpected start of stack: %v", d.msg) | ||
} | ||
if !strings.Contains(d.msg, "test_test.go") { | ||
t.Fatalf("Unexpected stack: %v", d.msg) | ||
} | ||
} |