Skip to content

Commit f35a8fd

Browse files
committed
Adds test.
1 parent 1f14dcc commit f35a8fd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

phpmainthread_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ func TestFinishBootingAWorkerScript(t *testing.T) {
177177
assert.Nil(t, phpThreads)
178178
}
179179

180+
func TestReturnAnErrorIf2WorkersHaveTheSameFileName(t *testing.T) {
181+
_, err1 := newWorker(workerOpt{fileName: "filename.php"})
182+
_, err2 := newWorker(workerOpt{fileName: "filename.php"})
183+
184+
assert.NoError(t, err1)
185+
assert.Error(t, err2, "2 workers cannot have the same filename")
186+
}
187+
180188
func getDummyWorker(fileName string) *worker {
181189
if workers == nil {
182190
workers = make(map[string]*worker)

0 commit comments

Comments
 (0)