This is not an acceptable way to fix these tests. Just removing the
expected error and adding a totally unnecessary tautological assertion is
not enough. These tests need to also verify that the correct method has
been invoked by checking the return value from the method call.

Rick
---------- Forwarded message ---------
From: orexx--- via Oorexx-svn <[email protected]>
Date: Tue, May 17, 2022 at 7:21 AM
Subject: [Oorexx-svn] SF.net SVN: oorexx-code-0:[12393]
test/trunk/ooRexx/base/class
To: <[email protected]>
Cc: <[email protected]>


Revision: 12393
          http://sourceforge.net/p/oorexx/code-0/12393
Author:   orexx
Date:     2022-05-17 11:21:31 +0000 (Tue, 17 May 2022)
Log Message:
-----------
[Feature-Requests:#802] Adjusted test groups.

Modified Paths:
--------------
    test/trunk/ooRexx/base/class/Message.testGroup
    test/trunk/ooRexx/base/class/Object.testGroup

Modified: test/trunk/ooRexx/base/class/Message.testGroup
===================================================================
--- test/trunk/ooRexx/base/class/Message.testGroup      2022-05-16 18:21:51
UTC (rev 12392)
+++ test/trunk/ooRexx/base/class/Message.testGroup      2022-05-17 11:21:31
UTC (rev 12393)
@@ -453,48 +453,48 @@
   m~replyWith('ghi', (1,2), 3)

 -- issued from a different class context
-::method test_send_override_bad_context
+::method test_send_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~send
+  self~assertTrue(.true)

 -- issued from a different class context
-::method test_sendwith_override_bad_context
+::method test_sendwith_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~sendWith(, (1,2))
+  self~assertTrue(.true)

 -- issued from a different class context
-::method test_start_override_bad_context
+::method test_start_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~start
   m~result
+  self~assertTrue(.true)

 -- issued from a different class context
-::method test_startwith_override_bad_context
+::method test_startwith_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~startWith(, (1,2))
   m~result
+  self~assertTrue(.true)

 -- issued from a different class context
-::method test_reply_override_bad_context
+::method test_reply_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~reply~result
+  self~assertTrue(.true)

 -- issued from a different class context
-::method test_replywith_override_bad_context
+::method test_replywith_override_context
   t1 = .superTester~new
-  self~expectSyntax(98.938)
   m = .message~new(t1, ('testOverride', .SuperTesterBase))
   m~replyWith(, (1,2))~result
+  self~assertTrue(.true)

 ::method test_override_empty_array
   self~expectSyntax(93.946)
@@ -702,21 +702,202 @@
   -- not description set if the error condition is raised
   self~assertEquals('HALT Test', condition~description)

-::method test_override_from_nonself
+
+-- SEND
+::method test_send_override_from_nonself
   arr="a","b"
-  self~assertEquals(2,arr~items)
-  self~assertEquals(2,arr~items:.collection,"override: ~item:.collection")
-  self~assertEquals(2,arr~copy:.object~items,"override:
arr~copy:.object~items")
+  m=.message~new(arr, "items")
+  self~assertEquals(2,m~send)

+  m=.message~new(arr, ("items",.collection) )
+  self~assertEquals(2,m~send)
+
+  m1=.message~new(arr, ("copy",.object) )
+  m2=.message~new(arr, ("items") )
+  self~assertEquals(2,m2~send(m1~send))
+
   not_a_superclass="nixi, noxi"
-  self~expectSyntax(97.1)
-  self~assertEquals(2,arr~items:not_a_superclass)
+  self~expectSyntax(88.914)  -- SCOPE must be an instance of the Class
class.
+  m=.message~new(arr, ("items",not_a_superclass) )
+  self~assertEquals(2,m~send)

-::method test_override_from_nonself_method_not_in_superclass
+::method test_send_override_from_nonself_method_not_in_superclass
   arr="a","b"
-  self~expectSyntax(97.1)
-  self~assertEquals(2,arr~items:.rexxinfo)   -- is not a superclass of
.array
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  m=.message~new(arr, ("items",.rexxinfo))
+  self~assertEquals(2,m~send)   -- is not a superclass of .array

+
+::method test_send_override_among_mixinclasses
+  o=.mixin2~new
+  m=.message~new(o,"info")
+  self~assertEquals("mixin2" , m~send)
+  m=.message~new(o,("info",.mixin2))
+  self~assertEquals("mixin2" , m~send)
+
+  m=.message~new(o,("info",.base))
+  self~assertEquals("base" , m~send)
+  m=.message~new(o,("info",.mixin1a))
+  self~assertEquals("mixin1a" , m~send)
+  m=.message~new(o,("info",.mixin1b))
+  self~assertEquals("mixin1b" , m~send)
+
+  self~expectSyntax(93.957)   -- "Target object "a MIXIN2" is not a
subclass of the message override scope (The NIXINOXI class)."
+  m=.message~new(o, ("info",.nixinoxi))
+  m~send
+
+-- SENDWITH
+::method test_sendWith_override_from_nonself
+  arr="a","b"
+  m=.message~new(arr, "items")
+  self~assertEquals(2,m~sendWith(arr,.array~new))
+
+  m=.message~new(arr, ("items",.collection) )
+  self~assertEquals(2,m~sendWith(arr,.array~new))
+
+  m1=.message~new(arr, ("copy",.object) )
+  m2=.message~new(arr, ("items") )
+  self~assertEquals(2,m2~sendWith(m1~sendWith(arr,.array~new),.array~new))
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)  -- SCOPE must be an instance of the Class
class.
+  m=.message~new(arr, ("items",not_a_superclass) )
+  self~assertEquals(2,m~sendWith(arr,.array~new))
+
+::method test_sendWith_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  m=.message~new(arr, ("items",.rexxinfo))
+  self~assertEquals(2,m~sendWith(arr,.array~new))   -- is not a superclass
of .array
+
+
+::method test_sendWith_override_among_mixinclasses
+  o=.mixin2~new
+  m=.message~new(o,"info")
+  self~assertEquals("mixin2" , m~sendWith(o,(1,2)))
+  m=.message~new(o,("info",.mixin2))
+  self~assertEquals("mixin2" , m~sendWith(o,(1,2)))
+
+  m=.message~new(o,("info",.base))
+  self~assertEquals("base" , m~sendWith(o,(1,2)))
+  m=.message~new(o,("info",.mixin1a))
+  self~assertEquals("mixin1a" , m~sendWith(o,(1,2)))
+  m=.message~new(o,("info",.mixin1b))
+  self~assertEquals("mixin1b" , m~sendWith(o,(1,2)))
+
+  m=.message~new(o, ("info",.nixinoxi))
+  self~expectSyntax(93.957)   -- "Target object "a MIXIN2" is not a
subclass of the message override scope (The NIXINOXI class)."
+  m~sendWith(o,(1,2))
+
+-- START
+::method test_start_override_from_nonself
+  arr="a","b"
+  m=.message~new(arr, "items")
+  self~assertEquals(2,m~~start~result)
+
+  m=.message~new(arr, ("items",.collection) )
+  self~assertEquals(2,m~~start~result)
+
+  m1=.message~new(arr, ("copy",.object) )
+  m2=.message~new(arr, ("items") )
+  self~assertEquals(2,m2~~start(m1~~start~result)~result)
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)  -- SCOPE must be an instance of the Class
class.
+  m=.message~new(arr, ("items",not_a_superclass) )
+  self~assertEquals(2,m~~start~result)
+
+::method test_start_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  m=.message~new(arr, ("items",.rexxinfo))
+  self~assertEquals(2,m~~start~result)   -- is not a superclass of .array
+
+
+::method test_start_override_among_mixinclasses
+  o=.mixin2~new
+  m=.message~new(o,"info")
+  self~assertEquals("mixin2" , m~~start~result)
+  m=.message~new(o,("info",.mixin2))
+  self~assertEquals("mixin2" , m~~start~result)
+
+  m=.message~new(o,("info",.base))
+  self~assertEquals("base" , m~~start~result)
+  m=.message~new(o,("info",.mixin1a))
+  self~assertEquals("mixin1a" , m~~start~result)
+  m=.message~new(o,("info",.mixin1b))
+  self~assertEquals("mixin1b" , m~~start~result)
+
+  self~expectSyntax(93.957)   -- "Target object "a MIXIN2" is not a
subclass of the message override scope (The NIXINOXI class)."
+  m=.message~new(o, ("info",.nixinoxi))
+  m~start~result
+
+-- STARTWITH
+::method test_startWith_override_from_nonself
+  arr="a","b"
+  m=.message~new(arr, "items")
+  self~assertEquals(2,m~~startWith(arr,.array~new)~result)
+
+  m=.message~new(arr, ("items",.collection) )
+  self~assertEquals(2,m~~startWith(arr,.array~new)~result)
+
+  m1=.message~new(arr, ("copy",.object) )
+  m2=.message~new(arr, ("items") )
+
self~assertEquals(2,m2~~startWith(m1~~startWith(arr,.array~new)~result,.array~new)~result)
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)  -- SCOPE must be an instance of the Class
class.
+  m=.message~new(arr, ("items",not_a_superclass) )
+  self~assertEquals(2,m~~startWith(arr,.array~new)~result)
+
+::method test_startWith_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  m=.message~new(arr, ("items",.rexxinfo))
+  self~assertEquals(2,m~~startWith(arr,.array~new)~result)   -- is not a
superclass of .array
+
+
+::method test_startWith_override_among_mixinclasses
+  o=.mixin2~new
+  m=.message~new(o,"info")
+  self~assertEquals("mixin2" , m~~startWith(o,(1,2))~result)
+  m=.message~new(o,("info",.mixin2))
+  self~assertEquals("mixin2" , m~~startWith(o,(1,2))~result)
+
+  m=.message~new(o,("info",.base))
+  self~assertEquals("base" , m~~startWith(o,(1,2))~result)
+  m=.message~new(o,("info",.mixin1a))
+  self~assertEquals("mixin1a" , m~~startWith(o,(1,2))~result)
+  m=.message~new(o,("info",.mixin1b))
+  self~assertEquals("mixin1b" , m~~startWith(o,(1,2))~result)
+
+  m=.message~new(o, ("info",.nixinoxi))
+  self~expectSyntax(93.957)   -- "Target object "a MIXIN2" is not a
subclass of the message override scope (The NIXINOXI class)."
+  m~~startWith(o,(1,2))~result
+
+
+::class nixinoxi     -- has info method, but class is on its own
+::method info
+  return "nixinoxi"
+
+::class base
+::method info
+  return "base"
+
+::class mixin1a mixinclass base
+::method info
+  return "mixin1a"
+
+::class mixin1b mixinclass base
+::method info
+  return "mixin1b"
+
+::class mixin2 mixinclass mixin1b inherit mixin1a
+::method info
+  return "mixin2"
+
+
+
 -- simple class with methods for testing async operation
 ::class StartTester
 ::method delayValueReturn

Modified: test/trunk/ooRexx/base/class/Object.testGroup
===================================================================
--- test/trunk/ooRexx/base/class/Object.testGroup       2022-05-16 18:21:51
UTC (rev 12392)
+++ test/trunk/ooRexx/base/class/Object.testGroup       2022-05-17 11:21:31
UTC (rev 12393)
@@ -158,10 +158,10 @@
   self~assertEquals(123, obj~testSendWith(obj, ('TestTarget',
.sendTester), (1,2)))

 -- issued from a different class context
-::method test_send_override_bad_context
+::method test_send_override_context
   obj = .sendTester~new
-  self~expectSyntax(98.938)
   obj~send(('TestTarget', .sendTester2))
+  self~assertTrue(.true)

 ::method test_send_override_empty_array
   obj = .sendTester~new
@@ -214,10 +214,10 @@
   obj~testSend(obj, ('TestTargetXXXX', .array))

 -- issued from a different class context
-::method test_sendwith_override_bad_context
+::method test_sendwith_override_context
   obj = .sendTester~new
-  self~expectSyntax(98.938)
   obj~sendWith(('TestTarget', .sendTester2), (1,2))
+  self~assertTrue(.true)

 ::method test_sendWith_override_empty_array
   obj = .sendTester~new
@@ -311,10 +311,10 @@
   self~assertEquals(123, obj~testStartWith(obj, ('TestTarget',
.sendTester), (1,2)))

 -- issued from a different class context
-::method test_start_override_bad_context
+::method test_start_override_context
   obj = .sendTester~new
-  self~expectSyntax(98.938)
   obj~start(('TestTarget', .sendTester2))
+  self~assertTrue(.true)

 ::method test_start_override_empty_array
   obj = .sendTester~new
@@ -402,10 +402,10 @@
   self~assertEquals(123, obj~testStartWith(obj, ('TestTarget',
.sendTester), (1,2)))

 -- issued from a different class context
-::method test_startWith_override_bad_context
+::method test_startWith_override_context
   obj = .sendTester~new
-  self~expectSyntax(98.938)
   obj~startWith(('TestTarget', .sendTester2), (1,2))
+  self~assertTrue(.true)

 ::method test_startWith_override_empty_array
   obj = .sendTester~new
@@ -1144,10 +1144,145 @@
   hash = ref~value~identityHash
   self~assertTrue(.UninitTracker~forceUninit(ref, hash))

+
+
 -- TODO:  add UNKNOWN method tests
 -- TODO:  add hashcode/== override tests for collections.

+-- SEND method
+::method test_send_override_from_nonself
+  arr="a","b"
+  self~assertEquals(2,arr~send("items") )
+  self~assertEquals(2,arr~send( ("items",.collection)))
+  self~assertEquals(2,arr~send( ("copy",.object))~send("items"))

+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~send( ("items",not_a_superclass)) )
+
+::method test_send_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~send( ("items", .rexxinfo)) )  -- is not a
superclass of .array
+
+
+::method test_send_override_among_mixinclasses
+  o=.mixin2~new
+  self~assertEquals("mixin2" , o~send("info")           )
+  self~assertEquals("mixin2" , o~send( ("info",.mixin2 )) )
+  self~assertEquals("base"   , o~send( ("info",.base   )) )
+  self~assertEquals("mixin1a", o~send( ("info",.mixin1a)) )
+  self~assertEquals("mixin1b", o~send( ("info",.mixin1b)) )
+
+  self~expectSyntax(93.957) -- "Target object "a MIXIN2" is not a subclass
of the message override scope (The NIXINOXI class)."
+  o~send( ("info",.nixinoxi) )
+
+-- SENDWITH method
+::method test_sendwith_override_from_nonself
+  arr="a","b"
+  self~assertEquals(2,arr~sendWith("items",.array~new) )
+  self~assertEquals(2,arr~sendWith( ("items",.collection),(1,2)))
+  self~assertEquals(2,arr~sendWith(
("copy",.object),.array~new)~sendWith("items",.array~new))
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~sendWith( ("items",not_a_superclass),.array~new)
)
+
+::method test_sendwith_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~sendWith( ("items", .rexxinfo),.array~new) )  --
is not a superclass of .array
+
+
+::method test_sendwith_override_among_mixinclasses
+  o=.mixin2~new
+  self~assertEquals("mixin2" , o~sendWith("info",(1,2))           )
+  self~assertEquals("mixin2" , o~sendWith( ("info",.mixin2 ),(1,2)) )
+  self~assertEquals("base"   , o~sendWith( ("info",.base   ),(1,2)) )
+  self~assertEquals("mixin1a", o~sendWith( ("info",.mixin1a),(1,2)) )
+  self~assertEquals("mixin1b", o~sendWith( ("info",.mixin1b),(1,2)) )
+
+  self~expectSyntax(93.957) -- "Target object "a MIXIN2" is not a subclass
of the message override scope (The NIXINOXI class)."
+  o~sendWith( ("info",.nixinoxi),(1,2) )
+
+-- START method
+::method test_start_override_from_nonself
+  arr="a","b"
+  self~assertEquals(2,arr~start("items")~result )
+  self~assertEquals(2,arr~start( ("items",.collection))~result)
+  self~assertEquals(2,arr~start(
("copy",.object))~result~start("items")~result)
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~start( ("items",not_a_superclass))~result )
+
+::method test_start_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~start( ("items", .rexxinfo))~result )  -- is not
a superclass of .array
+
+
+::method test_start_override_among_mixinclasses
+  o=.mixin2~new
+  self~assertEquals("mixin2" , o~start("info")~result           )
+  self~assertEquals("mixin2" , o~start( ("info",.mixin2 ))~result )
+  self~assertEquals("base"   , o~start( ("info",.base   ))~result )
+  self~assertEquals("mixin1a", o~start( ("info",.mixin1a))~result )
+  self~assertEquals("mixin1b", o~start( ("info",.mixin1b))~result )
+
+  self~expectSyntax(93.957) -- "Target object "a MIXIN2" is not a subclass
of the message override scope (The NIXINOXI class)."
+  o~start( ("info",.nixinoxi) )~result
+
+-- STARTWITH method
+::method test_startWith_override_from_nonself
+  arr="a","b"
+  self~assertEquals(2,arr~startWith("items",.array~new)~result )
+  self~assertEquals(2,arr~startWith(
("items",.collection),.array~new)~result)
+  self~assertEquals(2,arr~startWith(
("copy",.object),.array~new)~result~startWith("items",.array~new)~result)
+
+  not_a_superclass="nixi, noxi"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~startWith(
("items",not_a_superclass),.array~new)~result )
+
+::method test_startWith_override_from_nonself_method_not_in_superclass
+  arr="a","b"
+  self~expectSyntax(88.914)   -- "Argument SCOPE must be an instance of
the Class class."
+  self~assertEquals(2,arr~startWith( ("items",
.rexxinfo),.array~new)~result )  -- is not a superclass of .array
+
+
+::method test_startWith_override_among_mixinclasses
+  o=.mixin2~new
+  self~assertEquals("mixin2" , o~startWith("info",(1,2))~result           )
+  self~assertEquals("mixin2" , o~startWith( ("info",.mixin2
),(1,2))~result )
+  self~assertEquals("base"   , o~startWith( ("info",.base
 ),(1,2))~result )
+  self~assertEquals("mixin1a", o~startWith(
("info",.mixin1a),(1,2))~result )
+  self~assertEquals("mixin1b", o~startWith(
("info",.mixin1b),(1,2))~result )
+
+  self~expectSyntax(93.957) -- "Target object "a MIXIN2" is not a subclass
of the message override scope (The NIXINOXI class)."
+  o~startWith( ("info",.nixinoxi),(1,2) )~result
+
+
+::class nixinoxi     -- has info method, but class is on its own
+::method info
+  return "nixinoxi"
+
+::class base
+::method info
+  return "base"
+
+::class mixin1a mixinclass base
+::method info
+  return "mixin1a"
+
+::class mixin1b mixinclass base
+::method info
+  return "mixin1b"
+
+::class mixin2 mixinclass mixin1b inherit mixin1a
+::method info
+  return "mixin2"
+
+
 -- End of class: object.testGroup

 ::class test1



_______________________________________________
Oorexx-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-svn
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to