mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
- Update import from vm/rpcchainvm to vm/rpc/chain - Update vm dependency to v1.0.18 - node dependency now test-only (platformvm.NewClient for warp tests)
30 lines
993 B
Go
30 lines
993 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package gatherer_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
// NOTE: This test assumes that there are no imported packages that might
|
|
// change the default value of [metrics.Enabled]. It is therefore in package
|
|
// `gatherer_test` in case any other tests modify the variable. If any
|
|
// imports here or in the implementation do actually do so then this test
|
|
// may have false negatives.
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/luxfi/geth/metrics"
|
|
)
|
|
|
|
func TestMetricsEnabledByDefault(t *testing.T) {
|
|
assert.True(t, metrics.Enabled(), "geth/metrics.Enabled")
|
|
|
|
// Verify that a counter can be created (metrics are enabled)
|
|
counter := metrics.NewCounter()
|
|
assert.NotNil(t, counter, "metrics.NewCounter() should not return nil")
|
|
|
|
// Test that the counter works
|
|
counter.Inc(1)
|
|
assert.Equal(t, int64(1), counter.Snapshot().Count(), "counter should have value 1 after Inc(1)")
|
|
}
|