diff --git a/evaluator/datasets/polyglot_js/CHANGES.md b/evaluator/datasets/polyglot_js/CHANGES.md index b83532a0..15519f7f 100644 --- a/evaluator/datasets/polyglot_js/CHANGES.md +++ b/evaluator/datasets/polyglot_js/CHANGES.md @@ -336,7 +336,7 @@ Added typing to `promisify()`, `all()`, `allSettled()`, `race()`, and `any()`, a ## proverb -Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all. +Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all. Explained where the qualifier should be used. ## pythagorean-triplet @@ -400,7 +400,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst ## robot-simulator -Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be and what the methods should return. +Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be, what errors should be thrown, and what the methods should return. ## roman-numerals diff --git a/evaluator/datasets/polyglot_js/proverb/main.js b/evaluator/datasets/polyglot_js/proverb/main.js index fb2aec72..2da2ef1c 100644 --- a/evaluator/datasets/polyglot_js/proverb/main.js +++ b/evaluator/datasets/polyglot_js/proverb/main.js @@ -4,7 +4,7 @@ // /** - * @param {...string} args + * @param {...string | {qualifier: string}} args - The last argument may be an object with a `qualifier` property. The qualifier should go before the first argument in the conclusion. * @return {string} */ export const proverb = (...args) => { diff --git a/evaluator/datasets/polyglot_js/robot-simulator/main.js b/evaluator/datasets/polyglot_js/robot-simulator/main.js index 2ccd18f5..873f1df3 100644 --- a/evaluator/datasets/polyglot_js/robot-simulator/main.js +++ b/evaluator/datasets/polyglot_js/robot-simulator/main.js @@ -12,21 +12,22 @@ export class InvalidInputError extends Error { export class Robot { /** - * @returns {string} + * @returns {'north' | 'east' | 'south' | 'west'} */ get bearing() { throw new Error('Remove this line and implement the function'); } /** - * @returns {number[]} + * @returns {[number, number]} */ get coordinates() { throw new Error('Remove this line and implement the function'); } /** - * @param {{x: number, y: number, direction: string}} position + * @param {{x: number, y: number, direction: 'north' | 'east' | 'south' | 'west'}} position + * @throws {InvalidInputError} */ place({ x, y, direction }) { throw new Error('Remove this line and implement the function'); diff --git a/evaluator/datasets/polyglot_py/CHANGES.md b/evaluator/datasets/polyglot_py/CHANGES.md index 8d916cf7..ea4faff5 100644 --- a/evaluator/datasets/polyglot_py/CHANGES.md +++ b/evaluator/datasets/polyglot_py/CHANGES.md @@ -159,7 +159,7 @@ Added typing to `recite()`, as it is unclear what the parameter types should be ## forth -Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access. +Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. Added a missing exception message in the instructions that the tests look for. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access. ## gigasecond @@ -395,7 +395,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst ## robot-simulator -Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint. +Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint. Added `Robot.move()`, `Robot.direction`, and `Robot.coordinates` since they are needed by the tests. ## roman-numerals diff --git a/evaluator/datasets/polyglot_py/forth/instructions.md b/evaluator/datasets/polyglot_py/forth/instructions.md index b06134fc..b504c1e4 100644 --- a/evaluator/datasets/polyglot_py/forth/instructions.md +++ b/evaluator/datasets/polyglot_py/forth/instructions.md @@ -59,4 +59,7 @@ raise ZeroDivisionError("divide by zero") #an example when the operation is undefined. raise ValueError("undefined operation") + +# an example when the operation is not allowed. +raise ValueError('illegal operation') ``` diff --git a/evaluator/datasets/polyglot_py/list-ops/main.py b/evaluator/datasets/polyglot_py/list-ops/main.py index 6021e420..3e244526 100644 --- a/evaluator/datasets/polyglot_py/list-ops/main.py +++ b/evaluator/datasets/polyglot_py/list-ops/main.py @@ -21,11 +21,11 @@ def map(function: Callable[[Any], Any], list: list) -> list: pass -def foldl(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el) +def foldl(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el) pass -def foldr(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el) +def foldr(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el) pass diff --git a/evaluator/datasets/polyglot_py/robot-simulator/main.py b/evaluator/datasets/polyglot_py/robot-simulator/main.py index 72caa3b5..941622a8 100644 --- a/evaluator/datasets/polyglot_py/robot-simulator/main.py +++ b/evaluator/datasets/polyglot_py/robot-simulator/main.py @@ -11,3 +11,14 @@ class Robot: def __init__(self, direction: int = NORTH, x_pos: int = 0, y_pos: int = 0) -> None: pass + + def move(self, commands: str) -> None: + pass + + @property + def direction(self) -> int: + pass + + @property + def coordinates(self) -> Tuple[int, int]: + pass