1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-11-27 22:08:15 +02:00

New type system (#232)

* New type system

* Fixed dot notation for HTML elements
This commit is contained in:
Tim Voronov
2019-02-13 12:31:18 -05:00
committed by GitHub
parent b3bcbda3b9
commit 1af8b37a0f
185 changed files with 1379 additions and 820 deletions

View File

@@ -31,24 +31,28 @@ func (tc *testCase) Do(t *testing.T, fn core.Function) {
So(err, ShouldBeNil)
}
So(actual.Type(), ShouldEqual, expected.Type())
So(actual.Type().Equals(expected.Type()), ShouldBeTrue)
So(actual.Compare(expected), ShouldEqual, 0)
})
}
func mustDefaultLayoutDt(timeString string) values.DateTime {
dt, err := defaultLayoutDt(timeString)
if err != nil {
panic(err)
}
return dt
}
func mustLayoutDt(layout, value string) values.DateTime {
dt, err := layoutDt(layout, value)
if err != nil {
panic(err)
}
return dt
}
@@ -58,8 +62,10 @@ func defaultLayoutDt(timeString string) (values.DateTime, error) {
func layoutDt(layout, value string) (values.DateTime, error) {
t, err := time.Parse(layout, value)
if err != nil {
return values.DateTime{}, err
}
return values.NewDateTime(t), nil
}