new files

This commit is contained in:
Ingy döt Net 2013-04-10 12:38:42 -07:00
parent 3af7344581
commit 86c034bb8b
1364 changed files with 21352 additions and 0 deletions

View file

@ -0,0 +1 @@
pragma Assert (A = 42, "Oops!");

View file

@ -0,0 +1,3 @@
with Ada.Assertions; use Ada.Assertions;
...
Assert (A = 42, "Oops!");

View file

@ -0,0 +1,9 @@
#include <assert.h>
int main(){
int a;
/* ...input or change a here */
assert(a == 42); /* aborts program when a is not 42, unless the NDEBUG macro was defined */
return 0;
}

View file

@ -0,0 +1,12 @@
class MAIN
creation main
feature main is
local
test: TEST;
do
create test;
io.read_integer;
test.assert(io.last_integer);
end
end

View file

@ -0,0 +1 @@
open my $fh, '<', 'file' or die "Cannot open file: $!\n"; # $! contains the error message from the last error

View file

@ -0,0 +1,3 @@
...
~(assert (= N 42)) # Exists only in debug mode
...

View file

@ -0,0 +1,13 @@
#lang racket
(define/contract x
(=/c 42) ; make sure x = 42
42)
(define/contract f
(-> number? (or/c 'yes 'no)) ; function contract
(lambda (x)
(if (= 42 x) 'yes 'no)))
(f 42) ; succeeds
(f "foo") ; contract error!

View file

@ -0,0 +1,4 @@
assert(a == 42)
assert(a == 42, "a isn't equal to 42")
assume(a == 42)
assume(a == 42, "a isn't equal to 42")

View file

@ -0,0 +1,3 @@
foo := 41.
...
self assert: (foo == 42).