From 0f1e30d0ab59a518c52eb64b0042eec4d212ef2f Mon Sep 17 00:00:00 2001
From: Andreas Grois <andi@grois.info>
Date: Sat, 11 Jan 2025 23:39:24 +0100
Subject: Add simple unit test (and fix path output, as discovered by test)

---
 LeanAStarTest.lean | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 LeanAStarTest.lean

(limited to 'LeanAStarTest.lean')

diff --git a/LeanAStarTest.lean b/LeanAStarTest.lean
new file mode 100644
index 0000000..adca44d
--- /dev/null
+++ b/LeanAStarTest.lean
@@ -0,0 +1,14 @@
+import LeanAStarTest.Tests
+
+def main (params : List String) : IO UInt32 := do
+  if !params.isEmpty then
+    IO.println "Currently LeanAStarTest will run all tests, and not accept parameters."
+    return ⟨UInt32.size-1,by decide⟩
+  let mut result : UInt32 := 0
+  for (testName, test) in LeanAStarTests.ListTests do
+    if let Except.error e := test () then
+      IO.println s!"{testName} failed: {e}"
+      result := result + 1
+    else
+      IO.println s!"{testName} succeeded."
+  return result
-- 
cgit v1.2.3

