@@ -59,33 +59,82 @@ mod tests {
59
59
60
60
Command :: new ( cargo_bin ( "sketchlib" ) )
61
61
. current_dir ( sandbox. get_wd ( ) )
62
- . arg ( "merge" )
63
- . arg ( sandbox. file_string ( "test_merge_sketches1" , TestDir :: Input ) )
64
- . arg ( sandbox. file_string ( "test_merge_sketches2" , TestDir :: Input ) )
62
+ . arg ( "sketch" )
63
+ . args ( & [ "--k-vals" , "17" ] )
64
+ . arg ( "--seq-files" )
65
+ . arg ( sandbox. file_string ( "14412_3#82.contigs_velvet.fa.gz" , TestDir :: Input ) )
66
+ . arg ( sandbox. file_string ( "14412_3#84.contigs_velvet.fa.gz" , TestDir :: Input ) )
65
67
. arg ( "-v" )
66
- . args ( & [ "-o" , "merge_test " ] )
68
+ . args ( & [ "-o" , "part1 " ] )
67
69
. assert ( )
68
70
. success ( ) ;
69
71
70
- let merged_sketch: MultiSketch =
71
- MultiSketch :: load ( & sandbox. file_string ( "merge_test" , TestDir :: Output ) )
72
- . expect ( "Failed to load output merged sketch" ) ;
73
- let expected_sketch =
74
- MultiSketch :: load ( & sandbox. file_string ( "sketches_all" , TestDir :: Correct ) )
75
- . expect ( "Failed to load expected merged sketch" ) ;
72
+ Command :: new ( cargo_bin ( "sketchlib" ) )
73
+ . current_dir ( sandbox. get_wd ( ) )
74
+ . arg ( "sketch" )
75
+ . args ( & [ "--k-vals" , "17" ] )
76
+ . arg ( "--seq-files" )
77
+ . arg ( sandbox. file_string ( "R6.fa.gz" , TestDir :: Input ) )
78
+ . arg ( sandbox. file_string ( "TIGR4.fa.gz" , TestDir :: Input ) )
79
+ . arg ( "-v" )
80
+ . args ( & [ "-o" , "part2" ] )
81
+ . assert ( )
82
+ . success ( ) ;
83
+
84
+ Command :: new ( cargo_bin ( "sketchlib" ) )
85
+ . current_dir ( sandbox. get_wd ( ) )
86
+ . arg ( "sketch" )
87
+ . args ( & [ "--k-vals" , "17" ] )
88
+ . arg ( "--seq-files" )
89
+ . arg ( sandbox. file_string ( "14412_3#82.contigs_velvet.fa.gz" , TestDir :: Input ) )
90
+ . arg ( sandbox. file_string ( "14412_3#84.contigs_velvet.fa.gz" , TestDir :: Input ) )
91
+ . arg ( sandbox. file_string ( "R6.fa.gz" , TestDir :: Input ) )
92
+ . arg ( sandbox. file_string ( "TIGR4.fa.gz" , TestDir :: Input ) )
93
+ . arg ( "-v" )
94
+ . args ( & [ "-o" , "merged_ref" ] )
95
+ . assert ( )
96
+ . success ( ) ;
76
97
98
+ // Overlapping labels fails
99
+ Command :: new ( cargo_bin ( "sketchlib" ) )
100
+ . current_dir ( sandbox. get_wd ( ) )
101
+ . arg ( "merge" )
102
+ . arg ( "part1" )
103
+ . arg ( "part1" )
104
+ . arg ( "-v" )
105
+ . args ( & [ "-o" , "merged_test" ] )
106
+ . assert ( )
107
+ . failure ( ) ;
108
+
109
+ Command :: new ( cargo_bin ( "sketchlib" ) )
110
+ . current_dir ( sandbox. get_wd ( ) )
111
+ . arg ( "merge" )
112
+ . arg ( "part1" )
113
+ . arg ( "part2" )
114
+ . arg ( "-v" )
115
+ . args ( & [ "-o" , "merged_test" ] )
116
+ . assert ( )
117
+ . success ( ) ;
118
+
119
+ // Check .skd the same
77
120
let predicate_file = predicate:: path:: eq_file ( Path :: new (
78
- & sandbox. file_string ( "merge_test .skd" , TestDir :: Output ) ,
121
+ & sandbox. file_string ( "merged_test .skd" , TestDir :: Output ) ,
79
122
) ) ;
80
123
assert_eq ! (
81
124
true ,
82
125
predicate_file. eval( Path :: new(
83
- & sandbox. file_string( "sketches_all .skd" , TestDir :: Correct )
126
+ & sandbox. file_string( "merged_ref .skd" , TestDir :: Output )
84
127
) ) ,
85
128
"Merged sketch data does not match"
86
129
) ;
87
130
88
- // assess if sketch metadata are the same
131
+ // Check .skm the same
132
+ let merged_sketch: MultiSketch =
133
+ MultiSketch :: load ( & sandbox. file_string ( "merged_test" , TestDir :: Output ) )
134
+ . expect ( "Failed to load output merged sketch" ) ;
135
+ let expected_sketch =
136
+ MultiSketch :: load ( & sandbox. file_string ( "merged_ref" , TestDir :: Output ) )
137
+ . expect ( "Failed to load expected merged sketch" ) ;
89
138
assert_eq ! (
90
139
merged_sketch, expected_sketch,
91
140
"Merged sketch metadata does not match"
0 commit comments