github.com/sercand/please@v13.4.0+incompatible/src/ide/intellij/library_test.go (about) 1 package intellij 2 3 import ( 4 "bytes" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestLibraryToXml(t *testing.T) { 11 library := &Library{ 12 Name: "finagle-base-http", 13 ClassPaths: []Content{ 14 { 15 ContentURL: "jar://$USER_HOME$/code/git.corp.tmachine.io/CORE/plz-out/gen/third_party/java/com/twitter/finagle-base-http.jar!/", 16 }, 17 }, 18 SourcePaths: []Content{ 19 { 20 ContentURL: "jar://$USER_HOME$/code/git.corp.tmachine.io/CORE/plz-out/gen/third_party/java/com/twitter/finagle-base-http_src.jar!/", 21 }, 22 }, 23 } 24 25 buf := &bytes.Buffer{} 26 library.toXML(buf) 27 assert.Equal(t, 28 "<component name=\"libraryTable\">\n"+ 29 " <library name=\"finagle-base-http\">\n"+ 30 " <CLASSES>\n"+ 31 " <root url=\"jar://$USER_HOME$/code/git.corp.tmachine.io/CORE/plz-out/gen/third_party/java/com/twitter/finagle-base-http.jar!/\"></root>\n"+ 32 " </CLASSES>\n"+ 33 " <JAVADOC></JAVADOC>\n"+ 34 " <SOURCES>\n"+ 35 " <root url=\"jar://$USER_HOME$/code/git.corp.tmachine.io/CORE/plz-out/gen/third_party/java/com/twitter/finagle-base-http_src.jar!/\"></root>\n"+ 36 " </SOURCES>\n"+ 37 " </library>\n"+ 38 "</component>", buf.String()) 39 }