toBe(5); }); test('ps parsing leaves out the counting process and its ps child', function () { expect(ss_unix_processes_count_ps(SS_UNIX_PROCESSES_PS, [900, 901]))->toBe(3); }); test('a /proc listing counts numeric entries other than the counting process', function () { $entries = ['.', '..', '1', '2', '812', '900', 'self', 'thread-self', 'meminfo', 'sys']; expect(ss_unix_processes_count_proc($entries, 900))->toBe(3) ->and(ss_unix_processes_count_proc($entries, 77))->toBe(4); }); test('the running host reports at least one other process', function () { [$count, $status] = ss_unix_processes_collect(); expect($status)->toBe(0) ->and($count)->toMatch('/^\d+$/') ->and((int) $count)->toBeGreaterThan(0) ->and(ss_unix_processes())->toMatch('/^\d+$/'); });