77 "net/http"
88 "net/url"
99 "testing"
10+ "time"
1011)
1112
1213var emptyOptions = Options {}
@@ -25,8 +26,8 @@ func TestOptions_String(t *testing.T) {
2526 "1x2,fh,fit,fv,q80,r90" ,
2627 },
2728 {
28- Options {Width : 0.15 , Height : 1.3 , Rotate : 45 , Quality : 95 , Signature : "c0ffee" , Format : "png" },
29- "0.15x1.3,png,q95,r45,sc0ffee" ,
29+ Options {Width : 0.15 , Height : 1.3 , Rotate : 45 , Quality : 95 , Signature : "c0ffee" , Format : "png" , ValidUntil : time . Unix ( 123 , 0 ) },
30+ "0.15x1.3,png,q95,r45,sc0ffee,vu123 " ,
3031 },
3132 {
3233 Options {Width : 0.15 , Height : 1.3 , CropX : 100 , CropY : 200 },
@@ -86,7 +87,7 @@ func TestParseOptions(t *testing.T) {
8687 // flags, in different orders
8788 {"q70,1x2,fit,r90,fv,fh,sc0ffee,png" , Options {Width : 1 , Height : 2 , Fit : true , Rotate : 90 , FlipVertical : true , FlipHorizontal : true , Quality : 70 , Signature : "c0ffee" , Format : "png" }},
8889 {"r90,fh,sc0ffee,png,q90,1x2,fv,fit" , Options {Width : 1 , Height : 2 , Fit : true , Rotate : 90 , FlipVertical : true , FlipHorizontal : true , Quality : 90 , Signature : "c0ffee" , Format : "png" }},
89- {"cx100,cw300,1x2,cy200,ch400,sc,scaleUp" , Options {Width : 1 , Height : 2 , ScaleUp : true , CropX : 100 , CropY : 200 , CropWidth : 300 , CropHeight : 400 , SmartCrop : true }},
90+ {"cx100,cw300,1x2,cy200,ch400,sc,scaleUp,vu1234567890 " , Options {Width : 1 , Height : 2 , ScaleUp : true , CropX : 100 , CropY : 200 , CropWidth : 300 , CropHeight : 400 , SmartCrop : true , ValidUntil : time . Unix ( 1234567890 , 0 ) }},
9091 }
9192
9293 for _ , tt := range tests {
0 commit comments