From 677c9a195d4f3781a9702dfeff986e550be70e41 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 9 Oct 2007 13:09:48 +0000 Subject: [PATCH] added test for PR 8962 svn: r7463 --- collects/tests/drscheme/language-test.ss | 78 +++++++++++++----------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/collects/tests/drscheme/language-test.ss b/collects/tests/drscheme/language-test.ss index 978ff82b27..be2cb56e7a 100644 --- a/collects/tests/drscheme/language-test.ss +++ b/collects/tests/drscheme/language-test.ss @@ -90,6 +90,7 @@ the settings above should match r5rs (test-expression "(define qqq 2) (set! qqq 1)" "") (test-expression "(cond [(= 1 2) 3])" "") (test-expression "(cons 1 2)" "(1 . 2)") + (test-expression "(+ (list 1) 2)" "{bug09.png} +: expects type as 1st argument, given: (1); other arguments were: 2") (test-expression "'(1)" "(1)") (test-expression "(define shrd (box 1)) (list shrd shrd)" "(#&1 #&1)") @@ -186,6 +187,7 @@ the settings above should match r5rs (test-expression "(define qqq 2) (set! qqq 1)" "") (test-expression "(cond [(= 1 2) 3])" "") (test-expression "(cons 1 2)" "(1 . 2)") + (test-expression "(+ (list 1) 2)" "{bug09.png} +: expects type as 1st argument, given: (1); other arguments were: 2") (test-expression "'(1)" "(1)") (test-expression "(define shrd (box 1)) (list shrd shrd)" "(#&1 #&1)") @@ -288,6 +290,7 @@ the settings above should match r5rs (test-expression "(define qqq 2) (set! qqq 1)" "") (test-expression "(cond ((= 1 2) 3))" "") (test-expression "(cons 1 2)" "(1 . 2)") + (test-expression "(+ (list 1) 2)" "{bug09.png} +: expects type as 1st argument, given: (1); other arguments were: 2") (test-expression "'(1)" "(1)") (test-expression "(define shrd (cons 1 1)) (list shrd shrd)" "((1 . 1) (1 . 1))") @@ -365,10 +368,10 @@ the settings above should match r5rs (test-expression "class" "class: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: class") + "reference to an identifier before its definition: class") (test-expression "shared" "shared: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: shared") + "reference to an identifier before its definition: shared") (test-expression "(define (. x y) (* x y))" "read: illegal use of \".\"") @@ -376,7 +379,7 @@ the settings above should match r5rs (test-expression "call/cc" "call/cc: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: call/cc") + "reference to an identifier before its definition: call/cc") (test-expression "(error 'a \"~a\" 1)" "procedure error: expects 2 arguments, given 3: 'a \"~a\" 1") @@ -385,22 +388,23 @@ the settings above should match r5rs (test-expression "(time 1)" "time: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: time") + "reference to an identifier before its definition: time") (test-expression "true" "true") (test-expression "mred^" "mred^: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: mred^") + "reference to an identifier before its definition: mred^") (test-expression "(eq? 'a 'A)" "false") (test-expression "(set! x 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(define qqq 2) (set! qqq 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(cond [(= 1 2) 3])" "cond: all question results were false") (test-expression "(cons 1 2)" "cons: second argument must be of type , given 1 and 2") + (test-expression "(+ (list 1) 2)" "+: expects type as 1st argument, given: (cons 1 empty); other arguments were: 2") (test-expression "'(1)" "quote: expected a name after a ', found something else") (test-expression "(define shrd (list 1)) (list shrd shrd)" "(cons (cons 1 empty) (cons (cons 1 empty) empty))" @@ -440,7 +444,7 @@ the settings above should match r5rs (test-expression "argv" "argv: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: argv"))) + "reference to an identifier before its definition: argv"))) @@ -489,17 +493,17 @@ the settings above should match r5rs (test-expression "class" "class: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: class") + "reference to an identifier before its definition: class") (test-expression "shared" "shared: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: shared") + "reference to an identifier before its definition: shared") (test-expression "(define (. x y) (* x y))" "read: illegal use of \".\"") (test-expression "'(1 . 2)" "read: illegal use of \".\"") (test-expression "call/cc" "call/cc: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: call/cc") + "reference to an identifier before its definition: call/cc") (test-expression "(error 'a \"~a\" 1)" "procedure error: expects 2 arguments, given 3: 'a \"~a\" 1") @@ -508,21 +512,22 @@ the settings above should match r5rs (test-expression "(time 1)" "time: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: time") + "reference to an identifier before its definition: time") (test-expression "true" "true") (test-expression "mred^" "mred^: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: mred^") + "reference to an identifier before its definition: mred^") (test-expression "(eq? 'a 'A)" "false") (test-expression "(set! x 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(define qqq 2) (set! qqq 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(cond [(= 1 2) 3])" "cond: all question results were false") (test-expression "(cons 1 2)" "cons: second argument must be of type , given 1 and 2") + (test-expression "(+ (list 1) 2)" "+: expects type as 1st argument, given: (list 1); other arguments were: 2") (test-expression "'(1)" "(list 1)") (test-expression "(define shrd (list 1)) (list shrd shrd)" "(list (list 1) (list 1))" @@ -562,7 +567,7 @@ the settings above should match r5rs (test-expression "argv" "argv: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: argv"))) + "reference to an identifier before its definition: argv"))) @@ -609,17 +614,17 @@ the settings above should match r5rs (test-expression "class" "class: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: class") + "reference to an identifier before its definition: class") (test-expression "shared" "shared: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: shared") + "reference to an identifier before its definition: shared") (test-expression "(define (. x y) (* x y))" "read: illegal use of \".\"") (test-expression "'(1 . 2)" "read: illegal use of \".\"") (test-expression "call/cc" "call/cc: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: call/cc") + "reference to an identifier before its definition: call/cc") (test-expression "(error 'a \"~a\" 1)" "procedure error: expects 2 arguments, given 3: 'a \"~a\" 1") @@ -632,16 +637,17 @@ the settings above should match r5rs (test-expression "true" "true") (test-expression "mred^" "mred^: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: mred^") + "reference to an identifier before its definition: mred^") (test-expression "(eq? 'a 'A)" "false") (test-expression "(set! x 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(define qqq 2) (set! qqq 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(cond [(= 1 2) 3])" "cond: all question results were false") (test-expression "(cons 1 2)" "cons: second argument must be of type , given 1 and 2") + (test-expression "(+ (list 1) 2)" "+: expects type as 1st argument, given: (list 1); other arguments were: 2") (test-expression "'(1)" "(list 1)") (test-expression "(define shrd (list 1)) (list shrd shrd)" "(list (list 1) (list 1))" @@ -674,7 +680,7 @@ the settings above should match r5rs (test-expression "(car (list))" "car: expects argument of type ; given empty") (test-expression "argv" "argv: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: argv"))) + "reference to an identifier before its definition: argv"))) @@ -721,17 +727,17 @@ the settings above should match r5rs (test-expression "class" "class: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: class") + "reference to an identifier before its definition: class") (test-expression "shared" "shared: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: shared") + "reference to an identifier before its definition: shared") (test-expression "(define (. x y) (* x y))" "read: illegal use of \".\"") (test-expression "'(1 . 2)" "read: illegal use of \".\"") (test-expression "call/cc" "call/cc: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: call/cc") + "reference to an identifier before its definition: call/cc") (test-expression "(error 'a \"~a\" 1)" "procedure error: expects 2 arguments, given 3: 'a \"~a\" 1") @@ -744,16 +750,17 @@ the settings above should match r5rs (test-expression "true" "true") (test-expression "mred^" "mred^: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: mred^") + "reference to an identifier before its definition: mred^") (test-expression "(eq? 'a 'A)" "false") (test-expression "(set! x 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(define qqq 2) (set! qqq 1)" "set!: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: set!") + "reference to an identifier before its definition: set!") (test-expression "(cond [(= 1 2) 3])" "cond: all question results were false") (test-expression "(cons 1 2)" "cons: second argument must be of type , given 1 and 2") + (test-expression "(+ (list 1) 2)" "+: expects type as 1st argument, given: (list 1); other arguments were: 2") (test-expression "'(1)" "(list 1)") (test-expression "(define shrd (list 1)) (list shrd shrd)" "(list (list 1) (list 1))" @@ -786,7 +793,7 @@ the settings above should match r5rs (test-expression "(car (list))" "car: expects argument of type ; given empty") (test-expression "argv" "argv: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: argv"))) + "reference to an identifier before its definition: argv"))) @@ -832,7 +839,7 @@ the settings above should match r5rs (test-expression "class" "class: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: class") + "reference to an identifier before its definition: class") (test-expression "shared" "shared: found a use of `shared' that does not follow an open parenthesis") @@ -841,7 +848,7 @@ the settings above should match r5rs (test-expression "call/cc" "call/cc: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: call/cc") + "reference to an identifier before its definition: call/cc") (test-expression "(error 'a \"~a\" 1)" "procedure error: expects 2 arguments, given 3: 'a \"~a\" 1") @@ -854,16 +861,17 @@ the settings above should match r5rs (test-expression "true" "true") (test-expression "mred^" "mred^: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: mred^") + "reference to an identifier before its definition: mred^") (test-expression "(eq? 'a 'A)" "false") (test-expression "(set! x 1)" "x: name is not defined" - "set!: cannot set undefined identifier: x") + "set!: cannot set identifier before its definition: x") (test-expression "(define qqq 2) (set! qqq 1)" "(void)" "define: cannot redefine name: qqq\n(void)") (test-expression "(cond [(= 1 2) 3])" "cond: all question results were false") (test-expression "(cons 1 2)" "cons: second argument must be of type , given 1 and 2") + (test-expression "(+ (list 1) 2)" "+: expects type as 1st argument, given: (list 1); other arguments were: 2") (test-expression "'(1)" "(list 1)") (test-expression "(define shrd (list 1)) (list shrd shrd)" "(shared ((-1- (list 1))) (list -1- -1-))" @@ -896,7 +904,7 @@ the settings above should match r5rs (test-expression "(car (list))" "car: expects argument of type ; given empty") (test-expression "argv" "argv: name is not defined, not a parameter, and not a primitive name" - "reference to undefined identifier: argv"))) + "reference to an identifier before its definition: argv")))