@@ -79,6 +79,67 @@ describe('getInputs', () => {
7979 tags : [ ] ,
8080 }
8181 ] ,
82+ [
83+ 3 ,
84+ new Map < string , string > ( [
85+ [ 'labels' , 'mylabel=foo#bar\n#comment\nanother=bar' ] ,
86+ ] ) ,
87+ {
88+ context : context . ContextSource . workflow ,
89+ bakeTarget : 'docker-metadata-action' ,
90+ flavor : [ ] ,
91+ githubToken : '' ,
92+ images : [ ] ,
93+ labels : [ 'mylabel=foo#bar' , 'another=bar' ] ,
94+ annotations : [ ] ,
95+ sepLabels : '\n' ,
96+ sepTags : '\n' ,
97+ sepAnnotations : '\n' ,
98+ tags : [ ] ,
99+ }
100+ ] ,
101+ [
102+ 4 ,
103+ new Map < string , string > ( [
104+ [ 'annotations' , 'org.opencontainers.image.url=https://example.com/path#readme\n#comment\norg.opencontainers.image.source=https://github.com/docker/metadata-action' ] ,
105+ ] ) ,
106+ {
107+ context : context . ContextSource . workflow ,
108+ bakeTarget : 'docker-metadata-action' ,
109+ flavor : [ ] ,
110+ githubToken : '' ,
111+ images : [ ] ,
112+ labels : [ ] ,
113+ annotations : [
114+ 'org.opencontainers.image.url=https://example.com/path#readme' ,
115+ 'org.opencontainers.image.source=https://github.com/docker/metadata-action'
116+ ] ,
117+ sepLabels : '\n' ,
118+ sepTags : '\n' ,
119+ sepAnnotations : '\n' ,
120+ tags : [ ] ,
121+ }
122+ ] ,
123+ [
124+ 5 ,
125+ new Map < string , string > ( [
126+ [ 'tags' , 'type=raw,value=foo#bar\n#comment' ] ,
127+ [ 'flavor' , 'prefix=v#1\n#comment' ] ,
128+ ] ) ,
129+ {
130+ context : context . ContextSource . workflow ,
131+ bakeTarget : 'docker-metadata-action' ,
132+ flavor : [ 'prefix=v#1' ] ,
133+ githubToken : '' ,
134+ images : [ ] ,
135+ labels : [ ] ,
136+ annotations : [ ] ,
137+ sepLabels : '\n' ,
138+ sepTags : '\n' ,
139+ sepAnnotations : '\n' ,
140+ tags : [ 'type=raw,value=foo#bar' ] ,
141+ }
142+ ] ,
82143 ] ;
83144 test . each ( cases ) ( '[%d] given %o as inputs, returns %o' , async ( num : number , inputs : Map < string , string > , expected : context . Inputs ) => {
84145 inputs . forEach ( ( value : string , name : string ) => {
0 commit comments