Skip to content

Commit

Permalink
feat: <go> add multiple import together support
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 12, 2020
1 parent 318d9e1 commit d02af53
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,23 @@ import . "time"
assertEquals(codeFile.Imports[1].Source, "time")
assertEquals(codeFile.Imports[1].AsName, ".")
}

@Test
internal fun shouldIdentifyMultipleTogetherImport() {
var code = """
package main
import (
"fmt"
"html/template"
"os"
)
"""

val codeFile = GoAnalyser().analysis(code, "")
assertEquals(codeFile.Imports.size, 3)
assertEquals(codeFile.Imports[0].Source, "fmt")
assertEquals(codeFile.Imports[1].Source, "html/template")
assertEquals(codeFile.Imports[2].Source, "os")
}
}

0 comments on commit d02af53

Please # to comment.