Skip to content

Builtin clock function not fully tested #1191

Open
@xtreme-james-cooper

Description

@xtreme-james-cooper

I accidentally introduced a regression in my jlox interpreter - the one builtin function, clock, could take arbitrary arguments. I didn't notice for a bit since the jlox suite kept passing. The fix is pretty simple: add a test (in tests/function? in tests/regression?) to ensure clock errors if it is given arguments.

clock_args.lox:
clock(0); // expect runtime error: Expected 0 arguments but got 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions