~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to ftsh/test/forany.ftsh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Figure out that 3*5 = 15
 
3
#
 
4
 
 
5
try
 
6
        forany i in 1 2 3 4 5
 
7
                j=$i .mul. 5
 
8
                if $j .eq. 15
 
9
                        echo "$j"
 
10
                else
 
11
                        failure
 
12
                end
 
13
        end
 
14
        echo "correct success"
 
15
catch
 
16
        echo "incorrect failure"
 
17
        failure
 
18
end
 
19
 
 
20
#
 
21
# Without it, you can't find it.
 
22
#
 
23
 
 
24
try
 
25
        try for 5 seconds
 
26
                forany i in 1 2 4 5
 
27
                        j=$i .mul. 5
 
28
                        if $j .eq. 15
 
29
                                echo "$j"
 
30
                        else
 
31
                                failure
 
32
                        end
 
33
                end
 
34
        end
 
35
        echo "incorrect success"
 
36
catch
 
37
        echo "correct failure"
 
38
end
 
39