From 81f19004f0cf3784cda2482d7b1963bc60d9c38d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 22 Jul 2024 15:06:45 +0900 Subject: [PATCH] updated some test cases for class --- t/class-5001.err | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/t/class-5001.err b/t/class-5001.err index 5318dc6..7820cd4 100644 --- a/t/class-5001.err +++ b/t/class-5001.err @@ -1,3 +1,45 @@ +class ##ERROR: syntax error - no class body + +--- + +class B ##ERROR: syntax error - no class body + +--- + +class B ( ##ERROR: syntax error - block expression expected as 'class' body +) + +--- + +class B + ##ERROR: syntax error - prohibited binary operator - + + +--- + +J := 11 +class B { + if (J = 10) { + defun :*newA() { + return self + } + } else { + defun :*newB() { + return self + } + } +} + +t2 := (B:newB) +t1 := (B:newA) ##ERROR: exception not handled - "unable to send newA to B - 'newA' not found in B" + +--- + +class B [ x ] { + if (x > 0) { ##ERROR: syntax error - prohibited access to instance variable - x + } +} + +--- + class B [ x y ] { };