Initial Commit draft default tip

Fri, 19 Sep 2025 11:49:40 +0800

author
Gong Zhile <gongzl@stu.hebust.edu.cn>
date
Fri, 19 Sep 2025 11:49:40 +0800
changeset 0
a3bb50016d6f

Initial Commit

deno.json file | annotate | diff | comparison | revisions
main.ts file | annotate | diff | comparison | revisions
main_test.ts file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deno.json	Fri Sep 19 11:49:40 2025 +0800
@@ -0,0 +1,8 @@
+{
+  "tasks": {
+    "dev": "deno run --watch main.ts"
+  },
+  "imports": {
+    "@std/assert": "jsr:@std/assert@1"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.ts	Fri Sep 19 11:49:40 2025 +0800
@@ -0,0 +1,8 @@
+export function add(a: number, b: number): number {
+  return a + b;
+}
+
+// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts
+if (import.meta.main) {
+  console.log("Add 2 + 3 =", add(2, 3));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main_test.ts	Fri Sep 19 11:49:40 2025 +0800
@@ -0,0 +1,6 @@
+import { assertEquals } from "@std/assert";
+import { add } from "./main.ts";
+
+Deno.test(function addTest() {
+  assertEquals(add(2, 3), 5);
+});

mercurial