File: cl_randomize.lua

package info (click to toggle)
lua-busted 2.0~rc12-1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 656 kB
  • ctags: 310
  • sloc: sh: 191; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- supporting testfile; belongs to 'cl_spec.lua'
local unexpected = {}
local order = {}

describe('Randomizing test order with --shuffle flag', function()
  for i = 1, 100 do
    table.insert(unexpected, i)

    it('does 100 its', function()
      table.insert(order, i)
    end)
  end

  teardown('runs tests in randomized order', function()
    assert.are_not.same(unexpected, order)
  end)
end)