Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ansi-test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michał Herda
ansi-test
Commits
812e8af0
Commit
812e8af0
authored
22 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
Tests for warnings.
parent
2fff2c54
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansi-tests/error.lsp
+24
-0
24 additions, 0 deletions
ansi-tests/error.lsp
ansi-tests/load-conditions.lsp
+2
-0
2 additions, 0 deletions
ansi-tests/load-conditions.lsp
ansi-tests/warn.lsp
+161
-0
161 additions, 0 deletions
ansi-tests/warn.lsp
with
187 additions
and
0 deletions
ansi-tests/error.lsp
+
24
−
0
View file @
812e8af0
...
...
@@ -40,3 +40,27 @@
(error fmt)
(simple-error (c) (frob-simple-error c fmt))))
t)
(deftest error.6
(handler-case
(error 'simple-condition)
(error (c) :wrong)
(simple-condition (c) :right))
:right)
(deftest error.7
(handler-case
(error 'simple-warning)
(error (c) :wrong)
(simple-warning (c) :right)
(condition (c) :wrong2))
:right)
(deftest error.8
(let ((fmt "Boo!"))
(handler-case
(error 'simple-warning :format-control fmt)
(simple-warning (c) (frob-simple-warning c fmt))))
t)
;;; Tests for other conditions will in their own files.
This diff is collapsed.
Click to expand it.
ansi-tests/load-conditions.lsp
+
2
−
0
View file @
812e8af0
...
...
@@ -5,3 +5,5 @@
(load "error.lsp")
(load "cerror.lsp")
(load "check-type.lsp")
(load "warn.lsp")
This diff is collapsed.
Click to expand it.
ansi-tests/warn.lsp
0 → 100644
+
161
−
0
View file @
812e8af0
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Feb 23 20:48:12 2003
;;;; Contains: Tests for WARN
(in-package :cl-test)
(deftest warn.1
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn "This is a warning"))
warned)))
(nil) t)
(deftest warn.2
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning))))
(values
(multiple-value-list (warn "This is a warning"))
warned)))
(nil) t)
(deftest warn.3
(with-output-to-string
(*error-output*)
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(warn "Foo!"))))
"")
(deftest warn.4
(let ((str (with-output-to-string
(*error-output*)
(warn "Foo!"))))
(not (string= str "")))
t)
(deftest warn.5
(let ((warned nil))
(handler-bind
((simple-warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn "This is a warning"))
warned)))
(nil) t)
(deftest warn.6
(let ((warned nil))
(handler-bind
((simple-condition #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn "This is a warning"))
warned)))
(nil) t)
(deftest warn.7
(let ((warned nil))
(handler-bind
((condition #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn "This is a warning"))
warned)))
(nil) t)
(deftest warn.8
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn 'simple-warning :format-control "Foo!"))
warned)))
(nil) t)
(deftest warn.9
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn 'warning))
warned)))
(nil) t)
(deftest warn.10
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'simple-warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn (make-condition 'simple-warning :format-control "Foo!")))
warned)))
(nil) t)
(deftest warn.11
(let ((warned nil))
(handler-bind
((warning #'(lambda (c)
(assert (typep c 'warning))
(setf warned t)
(muffle-warning c))))
(values
(multiple-value-list (warn (make-condition 'warning)))
warned)))
(nil) t)
(deftest warn.12
(classify-error (warn 'condition))
type-error)
(deftest warn.13
(classify-error (warn 'simple-condition))
type-error)
(deftest warn.14
(classify-error (warn (make-condition 'simple-warning) :format-control "Foo"))
type-error)
(deftest warn.15
(classify-error (warn))
program-error)
(deftest warn.16
(classify-error (warn (make-condition 'condition)))
type-error)
(deftest warn.17
(classify-error (warn (make-condition 'simple-condition)))
type-error)
(deftest warn.18
(classify-error (warn (make-condition 'simple-error)))
type-error)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment