PHP Classes

File: state_test.go

Recommend this page to a friend!
  Classes of Wolfy-J   roadrunner   state_test.go   Download  
File: state_test.go
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: roadrunner
Run multiple tasks of PHP in parallel using Golang
Author: By
Last change:
Date: 5 years ago
Size: 827 bytes


Class file image Download
package roadrunner import ( "" "testing" ) func Test_NewState(t *testing.T) { st := newState(StateErrored) assert.Equal(t, "errored", st.String()) assert.NotEqual(t, 0, st.Updated().Unix()) assert.Equal(t, "inactive", newState(StateInactive).String()) assert.Equal(t, "ready", newState(StateReady).String()) assert.Equal(t, "working", newState(StateWorking).String()) assert.Equal(t, "stopped", newState(StateStopped).String()) assert.Equal(t, "undefined", newState(1000).String()) } func Test_IsActive(t *testing.T) { assert.False(t, newState(StateInactive).IsActive()) assert.True(t, newState(StateReady).IsActive()) assert.True(t, newState(StateWorking).IsActive()) assert.False(t, newState(StateStopped).IsActive()) assert.False(t, newState(StateErrored).IsActive()) }