Files
swift-mirror/test/Interpreter/reverse.swift
Doug Gregor faf1c45d14 Shuffle the files in the testsuite a bit to try to reflect language structure.
There's a lot more work to do here, but start to categorize tests
along the lines of what a specification might look like, with
directories (chapters) for basic concepts, declarations, expressions,
statements, etc.


Swift SVN r9958
2013-11-05 15:12:57 +00:00

29 lines
402 B
Swift

// RUN: %swift -i %s | FileCheck %s
// REQUIRES: swift_interpreter
def test()
{
print('[')
for i in reverse(0 .. 10) {
print(i)
print(' ')
}
print("]\n")
}
def testr()
{
print('[')
for i in reverse(reverse(0 .. 10)) {
print(i)
print(' ')
}
print("]\n")
}
test()
testr()
// CHECK: [9 8 7 6 5 4 3 2 1 0 ]
// CHECK: [0 1 2 3 4 5 6 7 8 9 ]