dodona-edu / universal-judge

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

Support language-specific literals #420

Closed niknetniko closed 1 year ago

niknetniko commented 1 year ago

Fixes #399.

As mentioned in the issue, you do need to be aware if you need to namespace function calls for each language or not. For example:

- tab: "My tab"
  testcases:
  - expression:
      c: "to_string(1+1)"
      haskell: "Submission.toString (1+1)"
      runhaskell: "Submission.toString (1+1)"
      java: "Submission.toString(1+1)"
      javascript: "submission.toString(1+1)"
      kotlin: "toString(1+1)"
      python: "submission.to_string(1+1)"
      csharp: "Submission.toString(1+1)"
    return: "2"
pdawyndt commented 1 year ago

Would it be possible to be consistent about i) always using a namespace and ii) always using the same namespace name?

niknetniko commented 1 year ago

Would it be possible to be consistent about i) always using a namespace and ii) always using the same namespace name?

Both would be difficult: always using a namespace is for example not possible in C, since C doesn't have namespaces. Using the same namespace everywhere is also difficult, since a TESTed "namespace" doesn't always mean the same thing: in Java this is a class name, while in Python it is a package name.