-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29304eb
commit e9758fd
Showing
4 changed files
with
124 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
package nsqd | ||
|
||
import ( | ||
"testing" | ||
"testing" | ||
) | ||
|
||
|
||
|
||
// Test generated using Keploy | ||
func TestPercentile_EmptyArray(t *testing.T) { | ||
data := []uint64{} | ||
result := percentile(50, data, len(data)) | ||
expected := uint64(0) | ||
if result != expected { | ||
t.Errorf("Expected %v, got %v", expected, result) | ||
} | ||
data := []uint64{} | ||
result := percentile(50, data, len(data)) | ||
expected := uint64(0) | ||
if result != expected { | ||
t.Errorf("Expected %v, got %v", expected, result) | ||
} | ||
} |
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,33 @@ | ||
package nsqlookupd | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/nsqio/nsq/internal/lg" | ||
) | ||
|
||
// Test generated using Keploy | ||
func TestNewOptions_DefaultValues_ValidHostname(t *testing.T) { | ||
|
||
opts := NewOptions() | ||
|
||
if opts.LogPrefix != "[nsqlookupd] " { | ||
t.Errorf("Expected LogPrefix to be '[nsqlookupd] ', got %v", opts.LogPrefix) | ||
} | ||
if opts.LogLevel != lg.INFO { | ||
t.Errorf("Expected LogLevel to be lg.INFO, got %v", opts.LogLevel) | ||
} | ||
if opts.TCPAddress != "0.0.0.0:4160" { | ||
t.Errorf("Expected TCPAddress to be '0.0.0.0:4160', got %v", opts.TCPAddress) | ||
} | ||
if opts.HTTPAddress != "0.0.0.0:4161" { | ||
t.Errorf("Expected HTTPAddress to be '0.0.0.0:4161', got %v", opts.HTTPAddress) | ||
} | ||
if opts.InactiveProducerTimeout != 300*time.Second { | ||
t.Errorf("Expected InactiveProducerTimeout to be 300 seconds, got %v", opts.InactiveProducerTimeout) | ||
} | ||
if opts.TombstoneLifetime != 45*time.Second { | ||
t.Errorf("Expected TombstoneLifetime to be 45 seconds, got %v", opts.TombstoneLifetime) | ||
} | ||
} |