From: SourceForge.net <no...@so...> - 2007-05-29 14:16:17
|
Bugs item #1727552, was opened at 2007-05-29 09:53 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1727552&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Classes Group: 3.2.0 >Status: Pending >Resolution: Fixed Priority: 5 Private: No Submitted By: Rony G. Flatscher (orexx) >Assigned to: Rick McGuire (bigrixx) Summary: "ordered_union" does not unite Initial Comment: Testing the setlike methods for the Array class in 3.2.0 exhibits an error in the current implementation: the "ordered_union" method carries out a set (no duplicate) union, whereas the union of two arrays (ordered collections) should result in a new collection containing all elements of both collections. A possible patch will be uploaded together with this report. Here's a nutshell test program: ---------- cut here ----------- a1=.array~of("1v", "2v", "2v", "2v") a2=.array~of( "2v", "2v", "3v") /* Expecting: a1~difference(a2): "1v", "2v" a2~difference(a1): "3v" a1~intersection(a2): "2v", "2v" a2~intersection(a2): "2v", "2v" a1~union(a2): "1v", "2v", "2v", "2v", "2v", "2v", "3v" a2~union(a1): "2v", "2v", "3v", "1v", "2v", "2v", "2v" a1~xor(a2): "1v", "2v", "3v" a2~xor(a3): "3v", "1v", "2v" */ call dump a1~difference(a2), "a1~difference(a2)" call dump a2~difference(a1), "a2~difference(a1)" call dump a1~intersection(a2), "a1~intersection(a2)" call dump a2~intersection(a1), "a2~intersection(a1)" call dump a1~union(a2), "a1~union(a2)" call dump a2~union(a1), "a2~union(a1)" call dump a1~xor(a2), "a1~xor(a2)" call dump a2~xor(a1), "a2~xor(a1)" ::routine dump use arg coll, title .output~charout((title": ")~left(20)) bFirst=.true do o over coll if bFirst then bFirst=.false else .output~charout(", ") .output~charout(o) end say ---------- cut here ----------- ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2007-05-29 10:16 Message: Logged In: YES user_id=1125291 Originator: NO Committed revision 407. ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2007-05-29 10:10 Message: Logged In: YES user_id=1125291 Originator: NO I shouldn't have to repeat this, but please, in the future, confine the test programs to just the bits necessary to demonstrate the bug. Cluttering the programs with examples of things that work makes for a lot of extra work for any developer working on a fix. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1727552&group_id=119701 |