about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-17T17·53+0000
committerVincent Ambo <tazjin@google.com>2020-01-17T17·53+0000
commitcc026178a94f94fa9c79cedc66cbaf5ab78c21c1 (patch)
treedbcf1a761b5b58bcc3159d05bdb32f3167a63d90 /test
Squashed 'third_party/lisp/trivial-backtrace/' content from commit 43ef7d9
git-subtree-dir: third_party/lisp/trivial-backtrace
git-subtree-split: 43ef7d947f4b4de767d0f91f28b50d9c03ad29d6
Diffstat (limited to 'test')
-rw-r--r--test/packages.lisp5
-rw-r--r--test/test-setup.lisp4
-rw-r--r--test/tests.lisp17
3 files changed, 26 insertions, 0 deletions
diff --git a/test/packages.lisp b/test/packages.lisp
new file mode 100644
index 000000000000..7dc3eae57682
--- /dev/null
+++ b/test/packages.lisp
@@ -0,0 +1,5 @@
+(in-package #:common-lisp-user)
+
+(defpackage #:trivial-backtrace-test
+  (:use #:common-lisp #:lift #:trivial-backtrace))
+
diff --git a/test/test-setup.lisp b/test/test-setup.lisp
new file mode 100644
index 000000000000..a46b3a196649
--- /dev/null
+++ b/test/test-setup.lisp
@@ -0,0 +1,4 @@
+(in-package #:trivial-backtrace-test)
+
+(deftestsuite trivial-backtrace-test ()
+  ())
diff --git a/test/tests.lisp b/test/tests.lisp
new file mode 100644
index 000000000000..9b32090f13e0
--- /dev/null
+++ b/test/tests.lisp
@@ -0,0 +1,17 @@
+(in-package #:trivial-backtrace-test)
+
+(deftestsuite generates-backtrace (trivial-backtrace-test)
+  ())
+
+(addtest (generates-backtrace)
+  test-1
+  (let ((output nil))
+    (handler-case 
+	(let ((x 1))
+	  (let ((y (- x (expt 1024 0))))
+	    (declare (optimize (safety 3)))
+	    (/ 2 y)))
+      (error (c)
+	(setf output (print-backtrace c :output nil))))
+    (ensure (stringp output))
+    (ensure (plusp (length output)))))