--- /dev/null
+IN: scratchpad
+USE: init
+USE: namespaces
+USE: test
+
+[
+ [ f ] [ "-no-user-init" cli-arg ] unit-test
+ [ f ] [ "user-init" get ] unit-test
+
+ [ f ] [ "-user-init" cli-arg ] unit-test
+ [ t ] [ "user-init" get ] unit-test
+
+ [ "sdl.factor" ] [ "sdl.factor" cli-arg ] unit-test
+] with-scope
--- /dev/null
+IN: scratchpad
+USE: interpreter
+USE: namespaces
+USE: stdio
+USE: test
+
+[
+ init-history
+ "2 2 +" history+
+ history.
+ [ "2 2 +" ] [ 0 get-history ] unit-test
+ [ 4 ] [ 0 redo ] unit-test
+ [ 4 ] [ "2 2 +" eval-catch ] unit-test
+ "The following will print an error; ignore it." print terpri
+ [ ] [ "clear drop" eval-catch ] unit-test
+] with-scope
USE: test
[ [ 1 2 3 4 ] ] [ [ 3 4 ] [ 1 2 ] ] [ "x" set "x" append@ "x" get ] test-word
+
[ [ 1 2 3 4 ] ] [ 4 [ 1 2 3 ] ] [ "x" set "x" add@ "x" get ] test-word
+
[ [ 1 ] ] [ 1 f ] [ "x" set "x" cons@ "x" get ] test-word
[ [ 1 | 2 ] ] [ 1 2 ] [ "x" set "x" cons@ "x" get ] test-word
[ [ 1 2 ] ] [ 1 [ 2 ] ] [ "x" set "x" cons@ "x" get ] test-word
[ [ 2 | 3 ] ] [ "x" uncons@ ] unit-test
[ [ 1 | 2 ] ] [ "x" uncons@ ] unit-test
+
+[ [ 5 4 3 1 ] ] [
+ [ 5 4 3 2 1 ] "x" set
+ 2 "x" remove@
+ "x" get
+] unit-test
+
+[ [ "hello" f ] ] [
+ "x" off
+ f "x" unique@
+ "hello" "x" unique@
+ f "x" unique@
+ 5 "x" unique@
+ f "x" unique@
+ 5 "x" remove@
+ "hello" "x" unique@
+ "x" get
+] unit-test
+
+[ [ "xyz" #{ 3 2 } 1/5 [ { } ] ] ] [
+ [, "xyz" , "xyz" unique,
+ #{ 3 2 } , #{ 3 2 } unique,
+ 1/5 , 1/5 unique,
+ [, { } unique, ,] , ,]
+] unit-test
+
+[ [ 1 2 3 4 ] ] [ [, 1 , [ 2 3 ] list, 4 , ,] ] unit-test
--- /dev/null
+IN: scratchpad
+USE: combinators
+USE: kernel
+USE: math
+USE: stack
+USE: test
+
+[ 0 1 2 3 4 ] [ 5 [ ] times* ] unit-test
+[ ] [ 0 [ ] times* ] unit-test
+
+[ #{ 1 1 } ] [ #{ 2 3 } #{ 1 0 } 2times-succ ] unit-test
+[ #{ 1 2 } ] [ #{ 2 3 } #{ 1 1 } 2times-succ ] unit-test
+[ #{ 2 0 } ] [ #{ 3 3 } #{ 1 2 } 2times-succ ] unit-test
+[ #{ 2 1 } ] [ #{ 3 3 } #{ 2 0 } 2times-succ ] unit-test
+[ #{ 2 0 } ] [ #{ 2 2 } #{ 1 1 } 2times-succ ] unit-test
+
+[ #{ 0 0 } #{ 0 1 } #{ 1 0 } #{ 1 1 } ]
+[ #{ 2 2 } [ ] 2times* ] unit-test
+
+[ #{ 0 0 } #{ 0 1 } #{ 0 2 } #{ 1 0 } #{ 1 1 } #{ 1 2 }
+ #{ 2 0 } #{ 2 1 } #{ 2 2 } ]
+[ #{ 3 3 } [ ] 2times* ] unit-test
"parse-number"
"prettyprint"
"image"
+ "init"
"inspector"
+ "interpreter"
"io/io"
"vectors"
"words"
"unparser"
"random"
+ "stream"
"math/bignum"
"math/bitops"
"math/gcd"