[Swift-devel] [Bug 331] New: Add basic regression tests for the twice-each bug

bugzilla-daemon at mcs.anl.gov bugzilla-daemon at mcs.anl.gov
Wed Apr 6 19:26:56 CDT 2011


https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=331

           Summary: Add basic regression tests for the twice-each bug
           Product: Swift
           Version: 0.93
          Platform: PC
        OS/Version: Mac OS
            Status: ASSIGNED
          Severity: normal
          Priority: P1
         Component: SwiftScript language
        AssignedTo: dk0966 at cs.ship.edu
        ReportedBy: wilde at mcs.anl.gov


Tests were added for the symptom of this bug that caused the mapper problem -
the bugs original symptom.

We should also add simple regression tests that test the most basic aspect of
this bug directly: foreach iterations being done more than once.

Here are a few of the original tests.  These could be packaged under language. 
We should stress foreach() in various ways, with input arrays created in
various ways.

David: this is a good exercise for adding new tests to the test suite.

---


com$ swift ~/swift/lab/zz3.swift
Swift svn swift-r4157 cog-r3056

RunID: 20110406-1915-z3zvkba8
Progress:
SwiftScript trace: for, 1
SwiftScript trace: for, 2
SwiftScript trace: for, 1
SwiftScript trace: for, 2
Final status:
com$ more foreachsite
com$
PATH=/home/wilde/swift/src/0.92/cog/modules/swift/dist/swift-svn/bin/:$PATH
com$ swift ~/swift/lab/zz3.swift
Swift svn swift-r4252 (swift modified locally) cog-r3088 (cog modified locally)

RunID: 20110406-1916-u4mstvs2
Progress:
SwiftScript trace: for, 2
SwiftScript trace: for, 1
Final status:
com$ cat ~/swift/lab/zz3.swift
int arr[];

arr[0]=1;
arr[1]=2;

foreach a in arr {
  trace("for", a);
}

com$ cat ~/swift/lab/zz6.swift
int arr[];

foreach a,i in [0:9] {
  arr[i] = i;
}

trace("arr",arr);

foreach a,i in arr {
  trace("for", a,i);
}

com$

-- 
Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the reporter.



More information about the Swift-devel mailing list