mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-17 01:32:22 +02:00
Fix typos (#446)
This commit is contained in:
@ -423,7 +423,7 @@ func main() {
|
||||
|
||||
## Proxy
|
||||
|
||||
By default, Ferret does not use any proxies. Partially, due to inability to force Chrome/Chromium (or any other Chrome Devtools Protocol compatible browser) to use a prticular proxy. It should be done during a browser launch.
|
||||
By default, Ferret does not use any proxies. Partially, due to inability to force Chrome/Chromium (or any other Chrome Devtools Protocol compatible browser) to use a particular proxy. It should be done during a browser launch.
|
||||
|
||||
But you can pass an address of a proxy server you want to use for static pages.
|
||||
|
||||
|
@ -115,7 +115,7 @@ func TestCollectInto(t *testing.T) {
|
||||
So(string(out), ShouldEqual, `[{"gender":"f","values":[{"active":true},{"active":true}]},{"gender":"m","values":[{"active":true},{"active":true},{"active":false}]}]`)
|
||||
})
|
||||
|
||||
Convey("Should create custom projection grouped by miltiple keys", t, func() {
|
||||
Convey("Should create custom projection grouped by multiple keys", t, func() {
|
||||
c := compiler.New()
|
||||
|
||||
prog, err := c.Compile(`
|
||||
|
@ -333,7 +333,7 @@ func TestForFilter(t *testing.T) {
|
||||
So(string(out), ShouldEqual, `[5,6,5]`)
|
||||
})
|
||||
|
||||
Convey("Should call funcions", t, func() {
|
||||
Convey("Should call functions", t, func() {
|
||||
c := compiler.New()
|
||||
counterA := 0
|
||||
counterB := 0
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
var (
|
||||
isFloat = values.NewBoolean(true)
|
||||
beginingEpoch = values.NewDateTime(time.Time{})
|
||||
beginningEpoch = values.NewDateTime(time.Time{})
|
||||
)
|
||||
|
||||
func TestDiff(t *testing.T) {
|
||||
@ -20,28 +20,28 @@ func TestDiff(t *testing.T) {
|
||||
&testCase{
|
||||
Name: "when less then 3 arguments",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{beginingEpoch},
|
||||
Args: []core.Value{beginningEpoch},
|
||||
ShouldErr: true,
|
||||
},
|
||||
&testCase{
|
||||
Name: "when more then 4 arguments",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{beginingEpoch, beginingEpoch, beginingEpoch, beginingEpoch, beginingEpoch},
|
||||
Args: []core.Value{beginningEpoch, beginningEpoch, beginningEpoch, beginningEpoch, beginningEpoch},
|
||||
ShouldErr: true,
|
||||
},
|
||||
&testCase{
|
||||
Name: "when wrong type argument",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{beginingEpoch, beginingEpoch, beginingEpoch},
|
||||
Args: []core.Value{beginningEpoch, beginningEpoch, beginningEpoch},
|
||||
ShouldErr: true,
|
||||
},
|
||||
&testCase{
|
||||
Name: "when the difference is 1 year and 1 month (int)",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.AddDate(1, 1, 0),
|
||||
beginningEpoch.AddDate(1, 1, 0),
|
||||
),
|
||||
values.NewString("y"),
|
||||
},
|
||||
@ -50,9 +50,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "when the difference is 1 year and 1 month (float)",
|
||||
Expected: values.NewFloat(1.084931506849315),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.AddDate(1, 1, 0),
|
||||
beginningEpoch.AddDate(1, 1, 0),
|
||||
),
|
||||
values.NewString("year"),
|
||||
isFloat,
|
||||
@ -62,9 +62,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "when date1 after date2 (int)",
|
||||
Expected: values.NewInt(2),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.Add(-time.Hour * 48),
|
||||
beginningEpoch.Add(-time.Hour * 48),
|
||||
),
|
||||
values.NewString("d"),
|
||||
},
|
||||
@ -73,9 +73,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "when date1 after date2 (float)",
|
||||
Expected: values.NewFloat(2),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.Add(-time.Hour * 48),
|
||||
beginningEpoch.Add(-time.Hour * 48),
|
||||
),
|
||||
values.NewString("d"),
|
||||
isFloat,
|
||||
@ -85,8 +85,8 @@ func TestDiff(t *testing.T) {
|
||||
Name: "when dates are equal (int)",
|
||||
Expected: values.NewInt(0),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
beginningEpoch,
|
||||
values.NewString("i"),
|
||||
},
|
||||
},
|
||||
@ -94,8 +94,8 @@ func TestDiff(t *testing.T) {
|
||||
Name: "when dates are equal (float)",
|
||||
Expected: values.NewFloat(0),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
beginningEpoch,
|
||||
values.NewString("y"),
|
||||
isFloat,
|
||||
},
|
||||
@ -115,9 +115,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "When difference is 1 " + unit + " (int)",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.AddDate(dates[0], dates[1], dates[2]),
|
||||
beginningEpoch.AddDate(dates[0], dates[1], dates[2]),
|
||||
),
|
||||
values.NewString(unit),
|
||||
},
|
||||
@ -126,9 +126,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "When difference is 1 " + unit + " (float)",
|
||||
Expected: values.NewFloat(1),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.AddDate(dates[0], dates[1], dates[2]),
|
||||
beginningEpoch.AddDate(dates[0], dates[1], dates[2]),
|
||||
),
|
||||
values.NewString(unit),
|
||||
isFloat,
|
||||
@ -150,9 +150,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "When difference is 1 " + unit + " (int)",
|
||||
Expected: values.NewInt(1),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.Add(durn),
|
||||
beginningEpoch.Add(durn),
|
||||
),
|
||||
values.NewString(unit),
|
||||
},
|
||||
@ -161,9 +161,9 @@ func TestDiff(t *testing.T) {
|
||||
Name: "When difference is 1 " + unit + " (int)",
|
||||
Expected: values.NewFloat(1),
|
||||
Args: []core.Value{
|
||||
beginingEpoch,
|
||||
beginningEpoch,
|
||||
values.NewDateTime(
|
||||
beginingEpoch.Add(durn),
|
||||
beginningEpoch.Add(durn),
|
||||
),
|
||||
values.NewString(unit),
|
||||
isFloat,
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Unit specifies an unit of time (Millsecond, Second...).
|
||||
// Unit specifies an unit of time (Millisecond, Second...).
|
||||
type Unit int
|
||||
|
||||
const (
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestPrecentile(t *testing.T) {
|
||||
func TestPercentile(t *testing.T) {
|
||||
Convey("Should return nth percentile value", t, func() {
|
||||
out, err := math.Percentile(
|
||||
context.Background(),
|
||||
|
@ -34,7 +34,7 @@ func variance(input *values.Array, sample values.Int) values.Float {
|
||||
|
||||
// When getting the mean of the squared differences
|
||||
// "sample" will allow us to know if it's a sample
|
||||
// or population and wether to subtract by one or not
|
||||
// or population and whether to subtract by one or not
|
||||
l := values.Float(input.Length() - (1 * sample))
|
||||
|
||||
return variance / l
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestKeepKeys(t *testing.T) {
|
||||
Convey("When not enought arguments)", t, func() {
|
||||
Convey("When not enough arguments)", t, func() {
|
||||
// there is no object
|
||||
obj, err := objects.KeepKeys(context.Background())
|
||||
|
||||
|
@ -67,7 +67,7 @@ func TestKeys(t *testing.T) {
|
||||
So(int(keysArray.Length()), ShouldEqual, 0)
|
||||
})
|
||||
|
||||
Convey("When not enought arguments", t, func() {
|
||||
Convey("When not enough arguments", t, func() {
|
||||
_, err := objects.Keys(context.Background())
|
||||
|
||||
So(err, ShouldBeError)
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestMerge(t *testing.T) {
|
||||
Convey("When not enought arguments", t, func() {
|
||||
Convey("When not enough arguments", t, func() {
|
||||
obj, err := objects.Merge(context.Background())
|
||||
|
||||
So(err, ShouldBeError)
|
||||
|
@ -57,7 +57,7 @@ func Zip(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
keys.ForEach(func(key core.Value, idx int) bool {
|
||||
k = key.(values.String)
|
||||
|
||||
// this is necessary to impelement ArangoDB's behavior.
|
||||
// this is necessary to implement ArangoDB's behavior.
|
||||
// in ArangoDB the first value in values is
|
||||
// associated with each key. Ex.:
|
||||
// -- query --
|
||||
|
@ -61,7 +61,7 @@ func format(template string, args []core.Value) (string, error) {
|
||||
|
||||
if betweenBrackets == "" {
|
||||
if argsCount <= lastArgIdx {
|
||||
err = errors.Errorf("not enought arguments")
|
||||
err = errors.Errorf("not enough arguments")
|
||||
return ""
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ func RegexSplit(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// RegexTest test wether the regexp has at least one match in the given text.
|
||||
// RegexTest test whether the regexp has at least one match in the given text.
|
||||
// @param text (String) - The string to split.
|
||||
// @param regex (String) - A regular expression to use for splitting the text.
|
||||
// @param caseInsensitive (Boolean) - If set to true, the matching will be case-insensitive. The default is false.
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
// Split splits the given string value into a list of strings, using the separator.
|
||||
// @params text (String) - The string to split.
|
||||
// @params separator (String) - The sperator.
|
||||
// @params separator (String) - The separator.
|
||||
// @params limit (Int) - Limit the number of split values in the result. If no limit is given, the number of splits returned is not bounded.
|
||||
// @returns strings (Array<String>) - Array of strings.
|
||||
func Split(_ context.Context, args ...core.Value) (core.Value, error) {
|
||||
|
Reference in New Issue
Block a user