From 3602bb886693c1caef6cc822c9930f8814f1c53e Mon Sep 17 00:00:00 2001 From: breblanc Date: Thu, 14 Nov 2024 17:26:26 +0100 Subject: [PATCH] add test files --- .../echo-function/solution/top-level-output.ts | 13 +++++++++++++ .../echo-function/solution/unknown-return-type.ts | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/exercises/echo-function/solution/top-level-output.ts create mode 100644 tests/exercises/echo-function/solution/unknown-return-type.ts diff --git a/tests/exercises/echo-function/solution/top-level-output.ts b/tests/exercises/echo-function/solution/top-level-output.ts new file mode 100644 index 00000000..4325cd2c --- /dev/null +++ b/tests/exercises/echo-function/solution/top-level-output.ts @@ -0,0 +1,13 @@ +function echo(content: Object) { + return content; +} + +function noEcho(content: Object) { + // Do nothing. +} + +function toString(number: Object): string { + return number.toString(); +} + +console.log("This is top-level output"); diff --git a/tests/exercises/echo-function/solution/unknown-return-type.ts b/tests/exercises/echo-function/solution/unknown-return-type.ts new file mode 100644 index 00000000..85b5d277 --- /dev/null +++ b/tests/exercises/echo-function/solution/unknown-return-type.ts @@ -0,0 +1,15 @@ +class Coord { + + public x: number; + public y: number; + + constructor(x: number, y: number ) { + this.x = x; + this.y = y; + } + +} + +function echo(content: unknown) { + return new Coord(5, 7); +}