@@ -79,7 +79,7 @@ func TestNew(t *testing.T) {
79
79
80
80
func TestNewSketchCasingWrong (t * testing.T ) {
81
81
sketchPath := paths .New ("testdata" , "SketchCasingWrong" )
82
- mainFilePath := paths . New ( "testadata" , "sketchcasingwrong.ino" ).String ()
82
+ mainFilePath := sketchPath . Join ( "sketchcasingwrong.ino" ).String ()
83
83
sketch , err := New (sketchPath .String (), mainFilePath , "" , []string {mainFilePath })
84
84
assert .Nil (t , sketch )
85
85
assert .Error (t , err )
@@ -91,12 +91,12 @@ func TestNewSketchCasingWrong(t *testing.T) {
91
91
}
92
92
93
93
func 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 })
97
97
assert .NotNil (t , sketch )
98
98
assert .NoError (t , err )
99
- assert .Equal (t , sketchPath , sketch .LocationPath )
99
+ assert .Equal (t , sketchPath . String () , sketch .LocationPath )
100
100
assert .Equal (t , mainFilePath , sketch .MainFile .Path )
101
101
assert .Len (t , sketch .OtherSketchFiles , 0 )
102
102
assert .Len (t , sketch .AdditionalFiles , 0 )
@@ -115,3 +115,26 @@ func TestCheckSketchCasingCorrect(t *testing.T) {
115
115
err := CheckSketchCasing (sketchFolder )
116
116
require .NoError (t , err )
117
117
}
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