@@ -38,29 +38,29 @@ func TestTemplateDescriptorCompare(t *testing.T) {
38
38
check (
39
39
40
40
CategoryBaseof ,
41
- TemplateDescriptor {Kind : "" , Layout : "" , Lang : "" , OutputFormat : "404" , MediaType : "text/html" },
42
- TemplateDescriptor {Kind : "" , Layout : "" , Lang : "" , OutputFormat : "html" , MediaType : "text/html" },
41
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , Lang : "" , OutputFormat : "404" , MediaType : "text/html" },
42
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , Lang : "" , OutputFormat : "html" , MediaType : "text/html" },
43
43
false ,
44
44
)
45
45
46
46
check (
47
47
CategoryLayout ,
48
48
TemplateDescriptor {Kind : "" , Lang : "en" , OutputFormat : "404" , MediaType : "text/html" },
49
- TemplateDescriptor {Kind : "" , Layout : "" , Lang : "" , OutputFormat : "alias" , MediaType : "text/html" },
49
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , Lang : "" , OutputFormat : "alias" , MediaType : "text/html" },
50
50
true ,
51
51
)
52
52
53
53
less (
54
54
CategoryLayout ,
55
- TemplateDescriptor {Kind : kinds .KindHome , Layout : "list" , OutputFormat : "html" },
56
- TemplateDescriptor {Layout : "list" , OutputFormat : "html" },
55
+ TemplateDescriptor {Kind : kinds .KindHome , LayoutFromTemplate : "list" , OutputFormat : "html" },
56
+ TemplateDescriptor {LayoutFromTemplate : "list" , OutputFormat : "html" },
57
57
TemplateDescriptor {Kind : kinds .KindHome , OutputFormat : "html" },
58
58
)
59
59
60
60
check (
61
61
CategoryLayout ,
62
- TemplateDescriptor {Kind : kinds .KindHome , Layout : "list" , OutputFormat : "html" , MediaType : "text/html" },
63
- TemplateDescriptor {Kind : kinds .KindHome , Layout : "list" , OutputFormat : "myformat" , MediaType : "text/html" },
62
+ TemplateDescriptor {Kind : kinds .KindHome , LayoutFromTemplate : "list" , OutputFormat : "html" , MediaType : "text/html" },
63
+ TemplateDescriptor {Kind : kinds .KindHome , LayoutFromTemplate : "list" , OutputFormat : "myformat" , MediaType : "text/html" },
64
64
false ,
65
65
)
66
66
}
@@ -78,20 +78,20 @@ func BenchmarkCompareDescriptors(b *testing.B) {
78
78
d1 , d2 TemplateDescriptor
79
79
}{
80
80
{
81
- TemplateDescriptor {Kind : "" , Layout : "" , OutputFormat : "404" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
82
- TemplateDescriptor {Kind : "" , Layout : "" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
81
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , OutputFormat : "404" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
82
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
83
83
},
84
84
{
85
- TemplateDescriptor {Kind : "page" , Layout : "single" , OutputFormat : "html" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
86
- TemplateDescriptor {Kind : "" , Layout : "list" , OutputFormat : "" , MediaType : "application/rss+xml" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
85
+ TemplateDescriptor {Kind : "page" , LayoutFromTemplate : "single" , OutputFormat : "html" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
86
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "list" , OutputFormat : "" , MediaType : "application/rss+xml" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
87
87
},
88
88
{
89
- TemplateDescriptor {Kind : "page" , Layout : "single" , OutputFormat : "html" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
90
- TemplateDescriptor {Kind : "" , Layout : "" , OutputFormat : "alias" , MediaType : "text/html" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
89
+ TemplateDescriptor {Kind : "page" , LayoutFromTemplate : "single" , OutputFormat : "html" , MediaType : "text/html" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
90
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "" , OutputFormat : "alias" , MediaType : "text/html" , Lang : "" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
91
91
},
92
92
{
93
- TemplateDescriptor {Kind : "page" , Layout : "single" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
94
- TemplateDescriptor {Kind : "" , Layout : "single" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "nn" , Variant1 : "" , Variant2 : "" , LayoutMustMatch : false , IsPlainText : false },
93
+ TemplateDescriptor {Kind : "page" , LayoutFromTemplate : "single" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "en" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
94
+ TemplateDescriptor {Kind : "" , LayoutFromTemplate : "single" , OutputFormat : "rss" , MediaType : "application/rss+xml" , Lang : "nn" , Variant1 : "" , Variant2 : "" , LayoutFromUserMustMatch : false , IsPlainText : false },
95
95
},
96
96
}
97
97
0 commit comments