@@ -242,10 +242,7 @@ impl<'a> ProvenanceTable<'a> {
242242 self . table_. record_length
243243 ) {
244244 Ok ( Some ( string) ) => Ok ( string) ,
245- Ok ( None ) => Err ( crate :: TskitError :: ValueError {
246- got : String :: from ( "None" ) ,
247- expected : String :: from ( "String" ) ,
248- } ) ,
245+ Ok ( None ) => Ok ( String :: from ( "" ) ) ,
249246 Err ( e) => Err ( e) ,
250247 }
251248 }
@@ -277,27 +274,27 @@ impl<'a> ProvenanceTable<'a> {
277274}
278275
279276#[ cfg( test) ]
280- mod test_trigger_provenance_errors {
277+ mod test_provenance_tables {
281278 use super :: * ;
282279 use crate :: test_fixtures:: make_empty_table_collection;
283280 use Provenance ;
284281
285282 #[ test]
286- #[ should_panic]
287283 fn test_empty_record_string ( ) {
288- //TODO: decide if we like this behavior:
289- //See GitHub issue 150 -- this behavior should change.
284+ // check for tables...
290285 let mut tables = make_empty_table_collection ( 1.0 ) ;
291- let row_id = tables. add_provenance ( & String :: from ( "" ) ) . unwrap ( ) ;
286+ let s = String :: from ( "" ) ;
287+ let row_id = tables. add_provenance ( & s) . unwrap ( ) ;
292288 let _ = tables. provenances ( ) . row ( row_id) . unwrap ( ) ;
293- }
294- }
295289
296- #[ cfg( test) ]
297- mod test_provenance_tables {
298- use super :: * ;
299- use crate :: test_fixtures:: make_empty_table_collection;
300- use Provenance ;
290+ // and for tree sequences...
291+ tables. build_index ( ) . unwrap ( ) ;
292+ let mut ts = tables
293+ . tree_sequence ( crate :: TreeSequenceFlags :: default ( ) )
294+ . unwrap ( ) ;
295+ let row_id = ts. add_provenance ( & s) . unwrap ( ) ;
296+ let _ = ts. provenances ( ) . row ( row_id) . unwrap ( ) ;
297+ }
301298
302299 #[ test]
303300 fn test_add_rows ( ) {
0 commit comments