summaryrefslogtreecommitdiff
path: root/mailbox/testsuite/mailbox/list.exp
blob: 8811e2ae3ad69101713978b94ee9e8d29fbc99f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2003, Free Software Foundation
#  
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#   
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#  
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 

set current_text [list "NULL" "NULL" "NULL" "NULL"]
set current_iter 0

proc make_promt {} {
    global current_iter
    global current_text
    global mailbox_prog_prompt
    
    set mailbox_prog_prompt "${current_iter}:\\([lindex $current_text $current_iter]\\)> "
}

proc prompt_text {text} {
    global current_iter
    global current_text

    set current_text [lreplace $current_text $current_iter $current_iter $text]
    make_promt 
}
	
proc prompt_iterator {iter} {
    global current_iter

    set current_iter $iter
    make_promt
}

prompt_iterator 0
prompt_text "NULL"

mailbox_prog_start "${top_builddir}/examples/listop"

mailbox_prog_command "add en to tre fire fem"
mailbox_prog_test "print" \
	"en" \
	"to" \
	"tre" \
	"fire" \
	"fem"

prompt_text "en"
mailbox_prog_test "next"

prompt_text "tre"
mailbox_prog_test "next 2"

prompt_iterator 1
mailbox_prog_test "iter 1"

prompt_text "to"
mailbox_prog_test "find to"

mailbox_prog_test "del tre fire"

prompt_text "fem"
mailbox_prog_test "next"

prompt_iterator 0
prompt_text "fem"
mailbox_prog_test "iter 0"
mailbox_prog_test "print" \
	"en" \
	"to" \
	"fem"

mailbox_prog_command "prep jeden dwa trzy cztery"

mailbox_prog_test "print" \
	"cztery" \
	"trzy" \
	"dwa" \
	"jeden" \
	"en" \
	"to" \
	"fem"

prompt_text "cztery"
mailbox_prog_test "first"

prompt_text "trzy"
mailbox_prog_test "del cztery"

prompt_text "3"
mailbox_prog_test "repl trzy 3"

prompt_iterator 1
mailbox_prog_test "iter 1"

prompt_text "3"
mailbox_prog_test "next 2"

mailbox_prog_send "quit"
mailbox_prog_stop

# End of list.exp

Return to:

Send suggestions and report system problems to the System administrator.