Changeset 88 for trunk


Ignore:
Timestamp:
08/06/09 11:28:55 (3 years ago)
Author:
dom
Message:

Fixed minor bug in fixtures:make_tree/2

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/TODO

    r87 r88  
    33Known issues: 
    44------------ 
    5  
    6 - fixtures:make_tree doesn't like {file, "a", "a"} in tree. 
    75 
    86Check for possible bugs: 
  • trunk/src/fixtures.erl

    r85 r88  
    4444    ok. 
    4545 
    46 normalise ([H | []]) -> 
    47     H; 
     46normalise ([String]) when is_list (String) -> 
     47    String; 
    4848normalise ([H | T]) when is_list (H) -> 
    4949    %% Inserts newlines when list of strings... 
    5050    normalise ([string: concat (H, string: concat ("\n", hd (T))) | tl (T)]); 
    51 normalise ([String]) when is_list (String) -> 
    52     String; 
    5351normalise (String) when is_list (String) -> 
    5452    String. 
  • trunk/src/fixtures_test.erl

    r47 r88  
    1212-export ([use_tree_destroys_tree_even_if_trapexit/0]). 
    1313-export ([use_tree_destroys_tree_even_if_killed_by_parent_link/0]). 
     14-export ([make_tree_accepts_single_character_content/0]). 
    1415 
    1516temporary_pathname () -> 
     
    5556    pass. 
    5657 
     58make_tree_accepts_single_character_content () -> 
     59    Tmp_dirname = fixtures: temporary_pathname(), 
     60    Tree = [{file, "myfile", "a"}], 
     61    ok = fixtures: make_tree (Tmp_dirname, Tree), 
     62    {ok, B} = file: read_file (filename: join (Tmp_dirname, "myfile")), 
     63    "a" = binary_to_list (B), 
     64    fixtures: delete_tree (Tmp_dirname), 
     65    pass. 
     66     
    5767use_tree_passes_a_tree_to_a_fun () -> 
    5868    Tmp = fixtures: temporary_pathname (), 
Note: See TracChangeset for help on using the changeset viewer.