Changeset 55


Ignore:
Timestamp:
04/26/09 12:02:19 (3 years ago)
Author:
dom
Message:

Made tests less sensitive to order of directory listings (difference between Ubuntu and Mac, or R11 and R12?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/directory_watcher_test.erl

    r54 r55  
    119119    [Foo, Bar, Toto] = [filename: join (Dir, Name) || {file, Name, _} <- Tree], 
    120120    Watcher = spawn_link (directory_watcher, init, [Dir, self ()]), 
    121     {{file, ".txt"}, Bar, found} = receive_one (), 
    122     {{file, ".txt"}, Foo, found} = receive_one (), 
    123     {{file, ".erl"}, Toto, found} = receive_one (), 
     121    Finds = [receive_one(), receive_one(), receive_one()], 
     122    [FoundBar, FoundFoo, FoundToto] = lists: keysort (2, Finds), 
     123    {{file, ".txt"}, Bar, found} = FoundBar, 
     124    {{file, ".txt"}, Foo, found} = FoundFoo, 
     125    {{file, ".erl"}, Toto, found} = FoundToto, 
    124126     
    125127    ok = file: write_file (Foo, list_to_binary ("Bye")), 
     
    130132    ok = file: write_file (Bar, list_to_binary ("Bye")), 
    131133    Watcher ! check, 
    132     {{file, ".txt"}, Bar, changed} = receive_one (), 
    133     Watcher ! check, 
    134     {{file, ".txt"}, Foo, changed} = receive_one (), 
     134    Changes = [receive_one(), receive_one()], 
     135    [ChangedBar, ChangedFoo] = lists: keysort (2, Changes), 
     136    {{file, ".txt"}, Bar, changed} = ChangedBar, 
     137    {{file, ".txt"}, Foo, changed} = ChangedFoo, 
    135138    ok. 
    136139 
Note: See TracChangeset for help on using the changeset viewer.