@@ -23,9 +23,6 @@ public void PackTest()
2323 Packer . Pack ( fileMap , "sample.unitypackage" ) ;
2424
2525 Assert . True ( File . Exists ( "sample.unitypackage" ) , "Package should have been created" ) ;
26- // now let's unpack and check it out
27- string fullpath = Path . GetFullPath ( "sample.unitypackage" ) ;
28- Console . WriteLine ( $ "Full path is { fullpath } ") ;
2926
3027 Unpacker . Unpack ( "sample.unitypackage" , "sample_out" ) ;
3128
@@ -44,6 +41,32 @@ public void PackTest()
4441 Assert . True ( meta2 . Contains ( "somethingelse" ) , "Packer should preserve our custom yaml files" ) ;
4542 }
4643
44+ [ Fact ]
45+ public void RecursivePackTest ( )
46+ {
47+ Dictionary < string , string > fileMap = new Dictionary < string , string >
48+ {
49+ [ "sample" ] = "Assets/UnityPacker" ,
50+ } ;
51+
52+ Packer . Pack ( fileMap , "recursivesample.unitypackage" ) ;
53+
54+ Assert . True ( File . Exists ( "recursivesample.unitypackage" ) , "Package should have been created" ) ;
55+
56+ Unpacker . Unpack ( "recursivesample.unitypackage" , "rsample_out" ) ;
57+
58+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/sample1.txt" ) , "sample1.txt should have been decompressed" ) ;
59+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/sample1.meta" ) , "sample1.meta should have been generated" ) ;
60+
61+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/childfolder/sample2.txt" ) , "sample2.txt should have been decompressed" ) ;
62+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/childfolder/sample2.meta" ) , "sample2.meta should have been generated" ) ;
63+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/box.png" ) , "box.png should have been decompressed" ) ;
64+ Assert . True ( File . Exists ( "rsample_out/Assets/UnityPacker/box.meta" ) , "box.meta should have been decompressed" ) ;
65+
66+ string meta2 = File . ReadAllText ( "rsample_out/Assets/UnityPacker/childfolder/sample2.meta" ) ;
67+ Assert . True ( meta2 . Contains ( "somethingelse" ) , "Packer should preserve our custom yaml files" ) ;
68+ }
69+
4770 private static byte [ ] GetMD5 ( string file )
4871 {
4972 using ( MD5 md5 = MD5 . Create ( ) )
0 commit comments