@@ -169,9 +169,9 @@ function testEmbeddedSpecs(testCase)
169
169
nwbFilePath = testCase .getRandomFilename();
170
170
nwbExport(nwb , nwbFilePath );
171
171
172
- % Verify that no namespaces were embedded in file
172
+ % Verify that core and hdmf-common were embedded in "empty" file
173
173
embeddedNamespaces = io .spec .listEmbeddedSpecNamespaces(nwbFilePath );
174
- testCase .verifyEmpty( embeddedNamespaces )
174
+ testCase .verifyEqual(sort( embeddedNamespaces ), { ' core ' , ' hdmf-common ' } )
175
175
176
176
ts = tests .factory .TimeSeriesWithTimestamps();
177
177
nwb .acquisition .set(' test' , ts );
@@ -249,5 +249,42 @@ function testWarnIfMissingNamespaceSpecification(testCase)
249
249
@() nwbExport(nwb , nwbFilePath ), ...
250
250
' NWB:validators:MissingEmbeddedNamespace' )
251
251
end
252
+
253
+ function testExportFileWithStringDataType(testCase )
254
+ nwb = tests .factory .NWBFile();
255
+
256
+ generalExperimenter = [" John Doe" , " Jane Doe" ];
257
+ generalExperimentDescription = " Test with string data types" ;
258
+ nwb.general_experimenter = generalExperimenter ;
259
+ nwb.general_experiment_description = generalExperimentDescription ;
260
+
261
+ ts = tests .factory .TimeSeriesWithTimestamps();
262
+ ts.comments = " String comment" ;
263
+ ts.data_unit = " test" ;
264
+
265
+ nwb .acquisition .set(" TimeSeries" , ts );
266
+ nwbFilename = testCase .getRandomFilename();
267
+ nwbExport(nwb , nwbFilename );
268
+
269
+ nwbIn = nwbRead(nwbFilename , ' ignorecache' );
270
+
271
+ testCase .assertEqual( ...
272
+ string( nwbIn .general_experimenter .load())' , ...
273
+ generalExperimenter )
274
+
275
+ testCase .assertEqual( ...
276
+ string(nwbIn .general_experiment_description )' , ...
277
+ generalExperimentDescription )
278
+
279
+ tsIn = nwbIn .acquisition .get(" TimeSeries" );
280
+
281
+ testCase .assertEqual( ...
282
+ string(tsIn .comments ), ...
283
+ ts .comments )
284
+
285
+ testCase .assertEqual( ...
286
+ string(tsIn .data_unit ), ...
287
+ ts .data_unit )
288
+ end
252
289
end
253
290
end
0 commit comments