dodona-edu / universal-judge

Universal judge for educational software testing
https://docs.dodona.be/en/tested
MIT License
9 stars 4 forks source link

Support advanced "null" type #380

Closed niknetniko closed 1 year ago

niknetniko commented 1 year ago

This allows us to enforce "null" in JavaScript, without accepting "undefined".

This is pretty JavaScript-specific, but so is the "undefined" type, and one of the desired features of the whole basic/advanced system is to support cases like this.

For example, to enforce null and not undefined in the DSL, you must cast the value (otherwise both null and undefined will be accepted):

- tab: "Test tab"
  testcases:
    - expression: 'some_function()'
      return_raw: 'null(None)'