Documentation
¶
Index ¶
- func BlogPostsToInterfaceSlice(posts []BlogPost) []interface{}
- func TestArrayCommandMethods(t *testing.T)
- type BlogPost
- type BooleanDrop
- type ContextProxyDrop
- type DropWithUndefinedMethod
- type ErrorDrop
- type IntegerDrop
- type SettingsDrop
- type SomethingWithLength
- type StringDrop
- type TemplateContextDrop
- type ThingWithToLiquid
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlogPostsToInterfaceSlice ¶
func BlogPostsToInterfaceSlice(posts []BlogPost) []interface{}
BlogPostsToInterfaceSlice converts a []BlogPost to []interface{} for comparison tests.
func TestArrayCommandMethods ¶
TestArrayCommandMethods tests array command methods like .last, .first, and .size.
Types ¶
type BlogPost ¶
type BlogPost struct {
Title string
Author string
Content string
CreatedAt time.Time
URL string
CommentsCount int
Published bool
Rating float64
}
BlogPost represents a blog post with various properties for testing slice type compatibility.
func NewBlogPost ¶
func NewBlogPost(title, author, content, url string, createdAt time.Time, commentsCount int, published bool, rating float64) BlogPost
NewBlogPost creates a new BlogPost with the given values.
func SampleBlogPosts ¶
func SampleBlogPosts() []BlogPost
SampleBlogPosts returns a slice of sample BlogPost instances for testing.
type BooleanDrop ¶
BooleanDrop is a drop that wraps a boolean value.
func NewBooleanDrop ¶
func NewBooleanDrop(value bool) *BooleanDrop
NewBooleanDrop creates a new BooleanDrop.
func (*BooleanDrop) String ¶
func (b *BooleanDrop) String() string
String returns the string representation.
func (*BooleanDrop) ToLiquidValue ¶
func (b *BooleanDrop) ToLiquidValue() interface{}
ToLiquidValue returns the boolean value.
type ContextProxyDrop ¶
ContextProxyDrop is a proxy for context access.
func (*ContextProxyDrop) LiquidMethodMissing ¶
func (c *ContextProxyDrop) LiquidMethodMissing(method string) interface{}
LiquidMethodMissing handles missing method calls by looking up in context.
type DropWithUndefinedMethod ¶
DropWithUndefinedMethod is a drop with a foo method but missing other methods.
func NewDropWithUndefinedMethod ¶
func NewDropWithUndefinedMethod() *DropWithUndefinedMethod
NewDropWithUndefinedMethod creates a new DropWithUndefinedMethod.
func (*DropWithUndefinedMethod) Foo ¶
func (d *DropWithUndefinedMethod) Foo() interface{}
Foo returns "foo".
type ErrorDrop ¶
ErrorDrop is a drop that raises various types of errors for testing.
func (*ErrorDrop) ArgumentError ¶
func (e *ErrorDrop) ArgumentError() interface{}
ArgumentError raises an ArgumentError.
func (*ErrorDrop) Exception ¶
func (e *ErrorDrop) Exception() interface{}
Exception raises a generic exception.
func (*ErrorDrop) RuntimeError ¶
func (e *ErrorDrop) RuntimeError() interface{}
RuntimeError raises a runtime error.
func (*ErrorDrop) StandardError ¶
func (e *ErrorDrop) StandardError() interface{}
StandardError raises a StandardError.
func (*ErrorDrop) SyntaxError ¶
func (e *ErrorDrop) SyntaxError() interface{}
SyntaxError raises a SyntaxError.
type IntegerDrop ¶
IntegerDrop is a drop that wraps an integer value.
func NewIntegerDrop ¶
func NewIntegerDrop(value interface{}) *IntegerDrop
NewIntegerDrop creates a new IntegerDrop.
func (*IntegerDrop) String ¶
func (i *IntegerDrop) String() string
String returns the string representation.
func (*IntegerDrop) ToLiquidValue ¶
func (i *IntegerDrop) ToLiquidValue() interface{}
ToLiquidValue returns the integer value.
type SettingsDrop ¶
SettingsDrop is a drop that provides settings access.
func NewSettingsDrop ¶
func NewSettingsDrop(settings map[string]interface{}) *SettingsDrop
NewSettingsDrop creates a new SettingsDrop.
func (*SettingsDrop) LiquidMethodMissing ¶
func (s *SettingsDrop) LiquidMethodMissing(key string) interface{}
LiquidMethodMissing handles missing method calls.
type SomethingWithLength ¶
SomethingWithLength is a drop with a length method that returns nil.
func NewSomethingWithLength ¶
func NewSomethingWithLength() *SomethingWithLength
NewSomethingWithLength creates a new SomethingWithLength.
func (*SomethingWithLength) Length ¶
func (s *SomethingWithLength) Length() interface{}
Length returns nil.
type StringDrop ¶
StringDrop is a drop that wraps a string value.
func NewStringDrop ¶
func NewStringDrop(value string) *StringDrop
NewStringDrop creates a new StringDrop.
func (*StringDrop) String ¶
func (s *StringDrop) String() string
String returns the string representation.
func (*StringDrop) ToLiquidValue ¶
func (s *StringDrop) ToLiquidValue() interface{}
ToLiquidValue returns the string value.
type TemplateContextDrop ¶
TemplateContextDrop is a drop that can access the template context.
func NewTemplateContextDrop ¶
func NewTemplateContextDrop() *TemplateContextDrop
NewTemplateContextDrop creates a new TemplateContextDrop.
func (*TemplateContextDrop) Baz ¶
func (t *TemplateContextDrop) Baz() interface{}
Baz returns a value from registers.
func (*TemplateContextDrop) Foo ¶
func (t *TemplateContextDrop) Foo() interface{}
Foo returns a test value.
func (*TemplateContextDrop) LiquidMethodMissing ¶
func (t *TemplateContextDrop) LiquidMethodMissing(method string) interface{}
LiquidMethodMissing handles missing method calls by looking up in context.
func (*TemplateContextDrop) LoopPos ¶
func (t *TemplateContextDrop) LoopPos() interface{}
LoopPos returns the current forloop index.
func (*TemplateContextDrop) Scopes ¶
func (t *TemplateContextDrop) Scopes() interface{}
Scopes returns the number of scopes in the context.
type ThingWithToLiquid ¶
type ThingWithToLiquid struct{}
ThingWithToLiquid is a test type that implements ToLiquid.
func (*ThingWithToLiquid) ToLiquid ¶
func (t *ThingWithToLiquid) ToLiquid() interface{}
ToLiquid returns a liquid representation.