summaryrefslogtreecommitdiff
path: root/internal/state_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-02-02 19:30:00 +0300
committerGitHub <[email protected]>2021-02-02 19:30:00 +0300
commit20a1a5d2eb26090e0eef0e6772330ee2a52526fa (patch)
treec282e18c20029f60a798576cb4fe47d2762ffba0 /internal/state_test.go
parent36f01dc035f42115fcfd3b77dc5df3098382cd9f (diff)
parent2bdf7fafa73cabf7cf63657a6b58f2a423ae0fcd (diff)
Merge pull request #522 from spiral/fix/named_loggerv2.0.0-beta.22
bug(logger): Incorrect parsing of nested log levels
Diffstat (limited to 'internal/state_test.go')
-rwxr-xr-xinternal/state_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/internal/state_test.go b/internal/state_test.go
index bdb05825..a0581d57 100755
--- a/internal/state_test.go
+++ b/internal/state_test.go
@@ -3,25 +3,26 @@ package internal
import (
"testing"
+ "github.com/spiral/roadrunner/v2/pkg/states"
"github.com/stretchr/testify/assert"
)
func Test_NewState(t *testing.T) {
- st := NewWorkerState(StateErrored)
+ st := NewWorkerState(states.StateErrored)
assert.Equal(t, "errored", st.String())
- assert.Equal(t, "inactive", NewWorkerState(StateInactive).String())
- assert.Equal(t, "ready", NewWorkerState(StateReady).String())
- assert.Equal(t, "working", NewWorkerState(StateWorking).String())
- assert.Equal(t, "stopped", NewWorkerState(StateStopped).String())
+ assert.Equal(t, "inactive", NewWorkerState(states.StateInactive).String())
+ assert.Equal(t, "ready", NewWorkerState(states.StateReady).String())
+ assert.Equal(t, "working", NewWorkerState(states.StateWorking).String())
+ assert.Equal(t, "stopped", NewWorkerState(states.StateStopped).String())
assert.Equal(t, "undefined", NewWorkerState(1000).String())
}
func Test_IsActive(t *testing.T) {
- assert.False(t, NewWorkerState(StateInactive).IsActive())
- assert.True(t, NewWorkerState(StateReady).IsActive())
- assert.True(t, NewWorkerState(StateWorking).IsActive())
- assert.False(t, NewWorkerState(StateStopped).IsActive())
- assert.False(t, NewWorkerState(StateErrored).IsActive())
+ assert.False(t, NewWorkerState(states.StateInactive).IsActive())
+ assert.True(t, NewWorkerState(states.StateReady).IsActive())
+ assert.True(t, NewWorkerState(states.StateWorking).IsActive())
+ assert.False(t, NewWorkerState(states.StateStopped).IsActive())
+ assert.False(t, NewWorkerState(states.StateErrored).IsActive())
}