extend("test")
extend("math")

describe("math:srand usage", () => {

  it("should produce a reproducible sequence from seed=42", () => {
    gen = math:srand(42)
    first = gen()
    second = gen()

    expect_equal(first, -707564821)
    expect_equal(second, -201124098)

    expect_equal( type(first), "int" )
    expect_equal( type(second), "int" )
  })

  it("should produce the same sequence if we re-seed the same number", () => {
    genA = math:srand(123)
    genB = math:srand(123)

    result1 = genA()
    result2 = genB()
  })
})
