Changeset 138950 for trunk/base


Ignore:
Timestamp:
Jul 24, 2015, 10:16:30 PM (5 years ago)
Author:
raimue@…
Message:

macports1.0: rewrite/fix test for ui_message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/tests/macports.test

    r138946 r138950  
    247247    UI message unit test.
    248248} -setup {
    249     set fd [open $pwd/message w+]
    250     set fd2 [open $pwd/log w+]
     249    set fd [open $pwd/message w]
     250    set fd2 [open $pwd/log w]
    251251    set macports::channels(0) $fd
    252     set macports::channels(debuglog) $fd2
    253252    set macports::current_phase test
    254253    set ::debuglog $fd2
     
    257256    close $fd
    258257    close $fd2
    259     set fd2 [open $pwd/message r]
     258
     259    set fd [open $pwd/message r]
     260    set fd2 [open $pwd/log r]
     261    set line [read $fd]
     262    if {$line ne "prefixargs\n"} {
     263        return "FAIL: wrong message: $line"
     264    }
    260265    set line [read $fd2]
    261     if {$line ne "prefixargs\n"} {
    262         return "FAIL: wrong message: $line"
    263     }
    264     close $fd2
    265 
    266     set fd [open $pwd/message w+]
    267     set fd2 [open $pwd/log w+]
    268     set res [ui_message debuglog prefix -nonewline arg]
     266    if {$line ne ":0:test args\n"} {
     267        return "FAIL: wrong log: $line"
     268    }
    269269    close $fd
    270270    close $fd2
     271
     272    set fd [open $pwd/message w]
     273    set fd2 [open $pwd/log w]
     274    set res [ui_message 0 prefix -nonewline arg]
     275    close $fd
     276    close $fd2
     277
     278    set fd [open $pwd/message r]
    271279    set fd2 [open $pwd/log r]
     280    set line [read $fd]
     281    if {$line ne "prefixarg"} {
     282        return "FAIL: wrong message: $line"
     283    }
    272284    set line [read $fd2]
    273     if {$line ne "prefixarg"} {
    274         return "FAIL: wrong message: $line"
    275     }
     285    if {$line ne ":0:test arg"} {
     286        return "FAIL: wrong log: $line"
     287    }
     288    close $fd
    276289    close $fd2
    277290
Note: See TracChangeset for help on using the changeset viewer.