@@ -79,7 +79,7 @@ func TestNew(t *testing.T) {
7979
8080func TestNewSketchCasingWrong (t * testing.T ) {
8181 sketchPath := paths .New ("testdata" , "SketchCasingWrong" )
82- mainFilePath := paths . New ( "testadata" , "sketchcasingwrong.ino" ).String ()
82+ mainFilePath := sketchPath . Join ( "sketchcasingwrong.ino" ).String ()
8383 sketch , err := New (sketchPath .String (), mainFilePath , "" , []string {mainFilePath })
8484 assert .Nil (t , sketch )
8585 assert .Error (t , err )
@@ -91,12 +91,12 @@ func TestNewSketchCasingWrong(t *testing.T) {
9191}
9292
9393func TestNewSketchCasingCorrect (t * testing.T ) {
94- sketchPath := paths .New ("testdata" , "SketchCasingCorrect" ). String ()
95- mainFilePath := paths . New ( "testadata" , "SketchCasingCorrect.ino" ).String ()
96- sketch , err := New (sketchPath , mainFilePath , "" , []string {mainFilePath })
94+ sketchPath := paths .New ("testdata" , "SketchCasingCorrect" )
95+ mainFilePath := sketchPath . Join ( "SketchCasingCorrect.ino" ).String ()
96+ sketch , err := New (sketchPath . String () , mainFilePath , "" , []string {mainFilePath })
9797 assert .NotNil (t , sketch )
9898 assert .NoError (t , err )
99- assert .Equal (t , sketchPath , sketch .LocationPath )
99+ assert .Equal (t , sketchPath . String () , sketch .LocationPath )
100100 assert .Equal (t , mainFilePath , sketch .MainFile .Path )
101101 assert .Len (t , sketch .OtherSketchFiles , 0 )
102102 assert .Len (t , sketch .AdditionalFiles , 0 )
@@ -115,3 +115,26 @@ func TestCheckSketchCasingCorrect(t *testing.T) {
115115 err := CheckSketchCasing (sketchFolder )
116116 require .NoError (t , err )
117117}
118+
119+ func TestSketchWithMarkdownAsciidocJson (t * testing.T ) {
120+ sketchPath := paths .New ("testdata" , "SketchWithMarkdownAsciidocJson" )
121+ mainFilePath := sketchPath .Join ("SketchWithMarkdownAsciidocJson.ino" ).String ()
122+ adocFilePath := sketchPath .Join ("foo.adoc" ).String ()
123+ jsonFilePath := sketchPath .Join ("foo.json" ).String ()
124+ mdFilePath := sketchPath .Join ("foo.md" ).String ()
125+
126+ sketch , err := New (sketchPath .String (), mainFilePath , "" , []string {mainFilePath , adocFilePath , jsonFilePath , mdFilePath })
127+ assert .NotNil (t , sketch )
128+ assert .NoError (t , err )
129+ assert .Equal (t , sketchPath .String (), sketch .LocationPath )
130+ assert .Equal (t , mainFilePath , sketch .MainFile .Path )
131+ assert .Len (t , sketch .OtherSketchFiles , 0 )
132+ require .Len (t , sketch .AdditionalFiles , 3 )
133+ require .Equal (t , "foo.adoc" , filepath .Base (sketch .AdditionalFiles [0 ].Path ))
134+ require .Equal (t , "foo.json" , filepath .Base (sketch .AdditionalFiles [1 ].Path ))
135+ require .Equal (t , "foo.md" , filepath .Base (sketch .AdditionalFiles [2 ].Path ))
136+ assert .Len (t , sketch .RootFolderFiles , 3 )
137+ require .Equal (t , "foo.adoc" , filepath .Base (sketch .RootFolderFiles [0 ].Path ))
138+ require .Equal (t , "foo.json" , filepath .Base (sketch .RootFolderFiles [1 ].Path ))
139+ require .Equal (t , "foo.md" , filepath .Base (sketch .RootFolderFiles [2 ].Path ))
140+ }
0 commit comments