Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FluxTestPackages = []*ast.Package{&ast.Package{ BaseNode: ast.BaseNode{ Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "hour_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\n\nt_duration_hour = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})))\n\ntest _duration_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "hour_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "hour_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "hour_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "hour_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "hour_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "hour_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "hour_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "hour_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "hour_duration_test.flux", Source: "t_duration_hour = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 34, }, File: "hour_duration_test.flux", Source: "t_duration_hour", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_hour", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "hour_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})))", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "hour_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "hour_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "hour_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "hour_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "hour_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "hour_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "hour_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "hour_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "hour_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "hour_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "hour_duration_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "hour_duration_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "hour_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "hour_duration_test.flux", Source: "(r) => ({r with _value: date.hour(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "hour_duration_test.flux", Source: "({r with _value: date.hour(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "hour_duration_test.flux", Source: "{r with _value: date.hour(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "hour_duration_test.flux", Source: "_value: date.hour(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "hour_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "hour_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "hour_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "hour_duration_test.flux", Source: "t", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "hour_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "hour_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 37, }, File: "hour_duration_test.flux", Source: "v", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "hour_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 37, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "hour_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "hour_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 37, }, File: "hour_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "hour_duration_test.flux", Source: "date.hour(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "hour_duration_test.flux", Source: "date.hour", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "hour_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "hour_duration_test.flux", Source: "hour", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "hour", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "hour_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.hour(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "hour_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "hour_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 34, }, File: "hour_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "hour_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "hour_duration_test.flux", Source: "_duration_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 39, }, File: "hour_duration_test.flux", Source: "_duration_hour", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_hour", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "hour_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 23, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "hour_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "hour_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "hour_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "hour_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "hour_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "hour_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "hour_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "hour_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "hour_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "hour_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "hour_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "hour_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "hour_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "hour_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "hour_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "hour_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "hour_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "hour_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "hour_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "hour_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "hour_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "hour_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "hour_duration_test.flux", Source: "fn: t_duration_hour", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "hour_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "hour_duration_test.flux", Source: "t_duration_hour", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_hour", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "hour_duration_test.flux", Source: "test _duration_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "hour_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "hour_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "hour_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "hour_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "hour_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 76, }, File: "hour_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"\n\nt_time_hour = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: r._time)})))\n\ntest _time_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "hour_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "hour_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "hour_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "hour_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "hour_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "hour_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 68, }, File: "hour_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"", Start: ast.Position{ Column: 1, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 39, }, File: "hour_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 39, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 68, }, File: "hour_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 73, }, File: "hour_time_test.flux", Source: "t_time_hour = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 70, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 70, }, File: "hour_time_test.flux", Source: "t_time_hour", Start: ast.Position{ Column: 1, Line: 70, }, }, }, Name: "t_time_hour", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 73, }, File: "hour_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: r._time)})))", Start: ast.Position{ Column: 15, Line: 70, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 73, }, File: "hour_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 71, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 71, }, File: "hour_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 71, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "hour_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 71, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "hour_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "hour_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 72, }, File: "hour_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 72, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "hour_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 72, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "hour_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 72, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 72, }, File: "hour_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 72, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 73, }, File: "hour_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 71, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "hour_time_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 10, Line: 73, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "hour_time_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 10, Line: 73, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 73, }, File: "hour_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 73, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "hour_time_test.flux", Source: "(r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "hour_time_test.flux", Source: "({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 21, Line: 73, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 73, }, File: "hour_time_test.flux", Source: "{r with _value: date.hour(t: r._time)}", Start: ast.Position{ Column: 22, Line: 73, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 73, }, File: "hour_time_test.flux", Source: "_value: date.hour(t: r._time)", Start: ast.Position{ Column: 30, Line: 73, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 73, }, File: "hour_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 73, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 73, }, File: "hour_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 48, Line: 73, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 73, }, File: "hour_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 48, Line: 73, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 73, }, File: "hour_time_test.flux", Source: "t", Start: ast.Position{ Column: 48, Line: 73, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 73, }, File: "hour_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 51, Line: 73, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 73, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 51, Line: 73, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 73, }, File: "hour_time_test.flux", Source: "_time", Start: ast.Position{ Column: 53, Line: 73, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 73, }, File: "hour_time_test.flux", Source: "date.hour(t: r._time)", Start: ast.Position{ Column: 38, Line: 73, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 73, }, File: "hour_time_test.flux", Source: "date.hour", Start: ast.Position{ Column: 38, Line: 73, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 73, }, File: "hour_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 73, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 73, }, File: "hour_time_test.flux", Source: "hour", Start: ast.Position{ Column: 43, Line: 73, }, }, }, Name: "hour", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 73, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 73, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 73, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 73, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 73, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 73, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 73, }, File: "hour_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 73, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 73, }, File: "hour_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 73, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 70, }, File: "hour_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 70, }, File: "hour_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 70, }, File: "hour_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 70, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 76, }, File: "hour_time_test.flux", Source: "_time_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 6, Line: 75, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 75, }, File: "hour_time_test.flux", Source: "_time_hour", Start: ast.Position{ Column: 6, Line: 75, }, }, }, Name: "_time_hour", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 76, }, File: "hour_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 19, Line: 75, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 76, }, File: "hour_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 2, Line: 76, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 76, }, File: "hour_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour}", Start: ast.Position{ Column: 3, Line: 76, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 76, }, File: "hour_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 76, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 76, }, File: "hour_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 76, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 76, }, File: "hour_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 76, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 76, }, File: "hour_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 76, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 76, }, File: "hour_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 76, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 76, }, File: "hour_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 76, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 76, }, File: "hour_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 76, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 76, }, File: "hour_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 76, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 76, }, File: "hour_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 76, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 76, }, File: "hour_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 76, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 76, }, File: "hour_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 76, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 76, }, File: "hour_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 76, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 76, }, File: "hour_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 76, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 76, }, File: "hour_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 76, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 76, }, File: "hour_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 76, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 76, }, File: "hour_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 76, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 76, }, File: "hour_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 76, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 76, }, File: "hour_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 76, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 76, }, File: "hour_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 76, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 76, }, File: "hour_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 76, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 76, }, File: "hour_time_test.flux", Source: "fn: t_time_hour", Start: ast.Position{ Column: 82, Line: 76, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 76, }, File: "hour_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 76, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 76, }, File: "hour_time_test.flux", Source: "t_time_hour", Start: ast.Position{ Column: 86, Line: 76, }, }, }, Name: "t_time_hour", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 76, }, File: "hour_time_test.flux", Source: "test _time_hour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 1, Line: 75, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "hour_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "hour_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "hour_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "hour_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "hour_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "microsecond_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\n\nt_duration_microsecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})))\n\ntest _duration_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "microsecond_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "microsecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "microsecond_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "microsecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "microsecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "microsecond_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "microsecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "microsecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 34, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_microsecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "microsecond_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 26, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "microsecond_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "microsecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "microsecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "microsecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "microsecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "microsecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "microsecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "microsecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "microsecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "microsecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "microsecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "microsecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "microsecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "microsecond_duration_test.flux", Source: "(r) => ({r with _value: date.microsecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "microsecond_duration_test.flux", Source: "({r with _value: date.microsecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "microsecond_duration_test.flux", Source: "{r with _value: date.microsecond(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "microsecond_duration_test.flux", Source: "_value: date.microsecond(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "microsecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "microsecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "microsecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 37, }, File: "microsecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "microsecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "microsecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 37, }, File: "microsecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "microsecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 71, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 71, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "microsecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 73, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "microsecond_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 58, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 37, }, File: "microsecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 58, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "microsecond_duration_test.flux", Source: "date.microsecond(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 37, }, File: "microsecond_duration_test.flux", Source: "date.microsecond", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "microsecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 37, }, File: "microsecond_duration_test.flux", Source: "microsecond", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "microsecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "microsecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.microsecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "microsecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 34, }, File: "microsecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 27, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "microsecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 27, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 34, }, File: "microsecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 33, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "microsecond_duration_test.flux", Source: "_duration_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 39, }, File: "microsecond_duration_test.flux", Source: "_duration_microsecond", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_microsecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "microsecond_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 30, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "microsecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 40, }, File: "microsecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "microsecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "microsecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "microsecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "microsecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "microsecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "microsecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "microsecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "microsecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "microsecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "microsecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "microsecond_duration_test.flux", Source: "fn: t_duration_microsecond", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "microsecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_microsecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "microsecond_duration_test.flux", Source: "test _duration_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "microsecond_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "microsecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "microsecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "microsecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "microsecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "microsecond_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"\n\nt_time_microsecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)})))\n\ntest _time_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "microsecond_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "microsecond_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "microsecond_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "microsecond_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "microsecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "microsecond_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "microsecond_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"", Start: ast.Position{ Column: 1, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 30, }, File: "microsecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 30, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "microsecond_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"", Start: ast.Position{ Column: 11, Line: 30, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 52, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond", Start: ast.Position{ Column: 1, Line: 52, }, }, }, Name: "t_time_microsecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "microsecond_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)})))", Start: ast.Position{ Column: 22, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "microsecond_time_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 53, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 53, }, File: "microsecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "microsecond_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "microsecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "microsecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 54, }, File: "microsecond_time_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "microsecond_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 54, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "microsecond_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 54, }, File: "microsecond_time_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "microsecond_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "microsecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "microsecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 55, }, File: "microsecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "microsecond_time_test.flux", Source: "(r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 14, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "microsecond_time_test.flux", Source: "({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 21, Line: 55, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "microsecond_time_test.flux", Source: "{r with _value: date.microsecond(t: r._time)}", Start: ast.Position{ Column: 22, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "microsecond_time_test.flux", Source: "_value: date.microsecond(t: r._time)", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 55, }, File: "microsecond_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "microsecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "microsecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 55, }, File: "microsecond_time_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "microsecond_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 58, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 55, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 58, Line: 55, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "microsecond_time_test.flux", Source: "_time", Start: ast.Position{ Column: 60, Line: 55, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "microsecond_time_test.flux", Source: "date.microsecond(t: r._time)", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 55, }, File: "microsecond_time_test.flux", Source: "date.microsecond", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 55, }, File: "microsecond_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 55, }, File: "microsecond_time_test.flux", Source: "microsecond", Start: ast.Position{ Column: 43, Line: 55, }, }, }, Name: "microsecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 55, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 55, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "microsecond_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 55, }, File: "microsecond_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "microsecond_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 52, }, File: "microsecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 52, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "microsecond_time_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 52, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "microsecond_time_test.flux", Source: "_time_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 6, Line: 57, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 57, }, File: "microsecond_time_test.flux", Source: "_time_microsecond", Start: ast.Position{ Column: 6, Line: 57, }, }, }, Name: "_time_microsecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "microsecond_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 26, Line: 57, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "microsecond_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 2, Line: 58, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "microsecond_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond}", Start: ast.Position{ Column: 3, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "microsecond_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 58, }, File: "microsecond_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "microsecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 58, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "microsecond_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 58, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "microsecond_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 58, }, File: "microsecond_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 58, }, File: "microsecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "microsecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 58, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 58, }, File: "microsecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "microsecond_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 58, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 58, }, File: "microsecond_time_test.flux", Source: "fn: t_time_microsecond", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 58, }, File: "microsecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 58, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond", Start: ast.Position{ Column: 86, Line: 58, }, }, }, Name: "t_time_microsecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "microsecond_time_test.flux", Source: "test _time_microsecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 1, Line: 57, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "microsecond_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "microsecond_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "microsecond_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "microsecond_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "microsecond_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "millisecond_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\n\nt_duration_millisecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})))\n\ntest _duration_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "millisecond_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "millisecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "millisecond_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "millisecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "millisecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "millisecond_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "millisecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "millisecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 34, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_millisecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "millisecond_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 26, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 37, }, File: "millisecond_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "millisecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "millisecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "millisecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "millisecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "millisecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "millisecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "millisecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "millisecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "millisecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "millisecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "millisecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "millisecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "millisecond_duration_test.flux", Source: "(r) => ({r with _value: date.millisecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "millisecond_duration_test.flux", Source: "({r with _value: date.millisecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "millisecond_duration_test.flux", Source: "{r with _value: date.millisecond(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "millisecond_duration_test.flux", Source: "_value: date.millisecond(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "millisecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "millisecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "millisecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 37, }, File: "millisecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "millisecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "millisecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 37, }, File: "millisecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "millisecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 71, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 71, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "millisecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 73, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "millisecond_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 58, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 37, }, File: "millisecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 58, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "millisecond_duration_test.flux", Source: "date.millisecond(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 37, }, File: "millisecond_duration_test.flux", Source: "date.millisecond", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "millisecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 37, }, File: "millisecond_duration_test.flux", Source: "millisecond", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "millisecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "millisecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.millisecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "millisecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 34, }, File: "millisecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 27, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "millisecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 27, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 34, }, File: "millisecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 33, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "millisecond_duration_test.flux", Source: "_duration_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 39, }, File: "millisecond_duration_test.flux", Source: "_duration_millisecond", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_millisecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "millisecond_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 30, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "millisecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 40, }, File: "millisecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "millisecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "millisecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "millisecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "millisecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "millisecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "millisecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "millisecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "millisecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "millisecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "millisecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "millisecond_duration_test.flux", Source: "fn: t_duration_millisecond", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "millisecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_millisecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 40, }, File: "millisecond_duration_test.flux", Source: "test _duration_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "millisecond_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "millisecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "millisecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "millisecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "millisecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "millisecond_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"\n\nt_time_millisecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)})))\n\ntest _time_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "millisecond_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "millisecond_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "millisecond_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "millisecond_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "millisecond_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "millisecond_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "millisecond_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"", Start: ast.Position{ Column: 1, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 30, }, File: "millisecond_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 30, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "millisecond_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"", Start: ast.Position{ Column: 11, Line: 30, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "millisecond_test.flux", Source: "t_time_millisecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 52, }, File: "millisecond_test.flux", Source: "t_time_millisecond", Start: ast.Position{ Column: 1, Line: 52, }, }, }, Name: "t_time_millisecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "millisecond_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)})))", Start: ast.Position{ Column: 22, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 55, }, File: "millisecond_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 53, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 53, }, File: "millisecond_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "millisecond_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "millisecond_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "millisecond_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 54, }, File: "millisecond_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "millisecond_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 54, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "millisecond_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 54, }, File: "millisecond_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "millisecond_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "millisecond_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "millisecond_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 55, }, File: "millisecond_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "millisecond_test.flux", Source: "(r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 14, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "millisecond_test.flux", Source: "({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 21, Line: 55, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "millisecond_test.flux", Source: "{r with _value: date.millisecond(t: r._time)}", Start: ast.Position{ Column: 22, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "millisecond_test.flux", Source: "_value: date.millisecond(t: r._time)", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 55, }, File: "millisecond_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "millisecond_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "millisecond_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 55, }, File: "millisecond_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 55, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "millisecond_test.flux", Source: "r._time", Start: ast.Position{ Column: 58, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 55, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 58, Line: 55, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "millisecond_test.flux", Source: "_time", Start: ast.Position{ Column: 60, Line: 55, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "millisecond_test.flux", Source: "date.millisecond(t: r._time)", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 55, }, File: "millisecond_test.flux", Source: "date.millisecond", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 55, }, File: "millisecond_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 55, }, File: "millisecond_test.flux", Source: "millisecond", Start: ast.Position{ Column: 43, Line: 55, }, }, }, Name: "millisecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 55, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 55, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "millisecond_test.flux", Source: "map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 55, }, File: "millisecond_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "millisecond_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 52, }, File: "millisecond_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 52, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "millisecond_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 52, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "millisecond_test.flux", Source: "_time_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 6, Line: 57, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 57, }, File: "millisecond_test.flux", Source: "_time_millisecond", Start: ast.Position{ Column: 6, Line: 57, }, }, }, Name: "_time_millisecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "millisecond_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 26, Line: 57, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "millisecond_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 2, Line: 58, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "millisecond_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond}", Start: ast.Position{ Column: 3, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "millisecond_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 58, }, File: "millisecond_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "millisecond_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "millisecond_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 58, }, File: "millisecond_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "millisecond_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 58, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "millisecond_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "millisecond_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 58, }, File: "millisecond_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "millisecond_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 58, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "millisecond_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 58, }, File: "millisecond_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "millisecond_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "millisecond_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 58, }, File: "millisecond_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "millisecond_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 58, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "millisecond_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "millisecond_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 58, }, File: "millisecond_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "millisecond_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 58, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 58, }, File: "millisecond_test.flux", Source: "fn: t_time_millisecond", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 58, }, File: "millisecond_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 58, }, File: "millisecond_test.flux", Source: "t_time_millisecond", Start: ast.Position{ Column: 86, Line: 58, }, }, }, Name: "t_time_millisecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 58, }, File: "millisecond_test.flux", Source: "test _time_millisecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 1, Line: 57, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "millisecond_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "millisecond_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "millisecond_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "millisecond_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "millisecond_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "minute_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\n\nt_duration_minute = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})))\n\ntest _duration_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "minute_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "minute_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "minute_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "minute_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "minute_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "minute_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "minute_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "minute_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "minute_duration_test.flux", Source: "t_duration_minute = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 34, }, File: "minute_duration_test.flux", Source: "t_duration_minute", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_minute", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "minute_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})))", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "minute_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "minute_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "minute_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "minute_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "minute_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "minute_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "minute_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "minute_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "minute_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "minute_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "minute_duration_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "minute_duration_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "minute_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "minute_duration_test.flux", Source: "(r) => ({r with _value: date.minute(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "minute_duration_test.flux", Source: "({r with _value: date.minute(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "minute_duration_test.flux", Source: "{r with _value: date.minute(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "minute_duration_test.flux", Source: "_value: date.minute(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "minute_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "minute_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "minute_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 37, }, File: "minute_duration_test.flux", Source: "t", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "minute_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "minute_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 37, }, File: "minute_duration_test.flux", Source: "v", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "minute_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 37, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "minute_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 68, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "minute_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 53, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 37, }, File: "minute_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 53, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "minute_duration_test.flux", Source: "date.minute(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "minute_duration_test.flux", Source: "date.minute", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "minute_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "minute_duration_test.flux", Source: "minute", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "minute", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "minute_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.minute(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "minute_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "minute_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 34, }, File: "minute_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "minute_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "minute_duration_test.flux", Source: "_duration_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 39, }, File: "minute_duration_test.flux", Source: "_duration_minute", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_minute", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "minute_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "minute_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "minute_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "minute_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "minute_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "minute_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "minute_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "minute_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "minute_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "minute_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "minute_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "minute_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "minute_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "minute_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "minute_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "minute_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "minute_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "minute_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "minute_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "minute_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "minute_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "minute_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "minute_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "minute_duration_test.flux", Source: "fn: t_duration_minute", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "minute_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "minute_duration_test.flux", Source: "t_duration_minute", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_minute", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "minute_duration_test.flux", Source: "test _duration_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "minute_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "minute_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "minute_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "minute_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "minute_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "minute_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"\n\nt_time_minute = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: r._time)})))\n\ntest _time_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "minute_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "minute_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "minute_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 35, }, File: "minute_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "minute_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 35, }, File: "minute_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 64, }, File: "minute_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 37, }, File: "minute_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 64, }, File: "minute_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "minute_time_test.flux", Source: "t_time_minute = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 66, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 66, }, File: "minute_time_test.flux", Source: "t_time_minute", Start: ast.Position{ Column: 1, Line: 66, }, }, }, Name: "t_time_minute", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "minute_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: r._time)})))", Start: ast.Position{ Column: 17, Line: 66, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "minute_time_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 67, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 67, }, File: "minute_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 68, }, File: "minute_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 68, }, File: "minute_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 68, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 68, }, File: "minute_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 68, }, File: "minute_time_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 68, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 68, }, File: "minute_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 68, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 68, }, File: "minute_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 68, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 68, }, File: "minute_time_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 68, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 69, }, File: "minute_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "minute_time_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "minute_time_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 69, }, File: "minute_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "minute_time_test.flux", Source: "(r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 14, Line: 69, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "minute_time_test.flux", Source: "({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 21, Line: 69, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 69, }, File: "minute_time_test.flux", Source: "{r with _value: date.minute(t: r._time)}", Start: ast.Position{ Column: 22, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 69, }, File: "minute_time_test.flux", Source: "_value: date.minute(t: r._time)", Start: ast.Position{ Column: 30, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 69, }, File: "minute_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 69, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "minute_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "minute_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 69, }, File: "minute_time_test.flux", Source: "t", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "minute_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 53, Line: 69, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 69, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 53, Line: 69, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "minute_time_test.flux", Source: "_time", Start: ast.Position{ Column: 55, Line: 69, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 69, }, File: "minute_time_test.flux", Source: "date.minute(t: r._time)", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 69, }, File: "minute_time_test.flux", Source: "date.minute", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 69, }, File: "minute_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 69, }, File: "minute_time_test.flux", Source: "minute", Start: ast.Position{ Column: 43, Line: 69, }, }, }, Name: "minute", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 69, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 69, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 69, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 69, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 69, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 69, }, File: "minute_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 69, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 69, }, File: "minute_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 69, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 66, }, File: "minute_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 66, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 66, }, File: "minute_time_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 66, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 66, }, File: "minute_time_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 66, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "minute_time_test.flux", Source: "_time_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 6, Line: 71, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 71, }, File: "minute_time_test.flux", Source: "_time_minute", Start: ast.Position{ Column: 6, Line: 71, }, }, }, Name: "_time_minute", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "minute_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 21, Line: 71, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "minute_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 2, Line: 72, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 72, }, File: "minute_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute}", Start: ast.Position{ Column: 3, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "minute_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 72, }, File: "minute_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 72, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "minute_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "minute_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 72, }, File: "minute_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "minute_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 72, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "minute_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 72, }, File: "minute_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 72, }, File: "minute_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 72, }, File: "minute_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 72, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 72, }, File: "minute_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 72, }, File: "minute_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 72, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "minute_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "minute_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 72, }, File: "minute_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "minute_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 72, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 72, }, File: "minute_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 72, }, File: "minute_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 72, }, File: "minute_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 72, }, File: "minute_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 72, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 72, }, File: "minute_time_test.flux", Source: "fn: t_time_minute", Start: ast.Position{ Column: 82, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 72, }, File: "minute_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 72, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 72, }, File: "minute_time_test.flux", Source: "t_time_minute", Start: ast.Position{ Column: 86, Line: 72, }, }, }, Name: "t_time_minute", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "minute_time_test.flux", Source: "test _time_minute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 1, Line: 71, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "minute_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "minute_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "minute_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "minute_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "minute_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "month_day_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\n\nt_duration_month_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})))\n\ntest _duration_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "month_day_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "month_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_day_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "month_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "month_day_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "month_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "month_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 34, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_month_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "month_day_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 24, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "month_day_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "month_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "month_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "month_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "month_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "month_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "month_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "month_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "month_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "month_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "month_day_duration_test.flux", Source: "(r) => ({r with _value: date.monthDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "month_day_duration_test.flux", Source: "({r with _value: date.monthDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "month_day_duration_test.flux", Source: "{r with _value: date.monthDay(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "month_day_duration_test.flux", Source: "_value: date.monthDay(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "month_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 52, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 52, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 37, }, File: "month_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 52, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "month_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "month_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 37, }, File: "month_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "month_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 68, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 37, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 68, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "month_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 70, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_day_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 37, }, File: "month_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 55, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "month_day_duration_test.flux", Source: "date.monthDay(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 37, }, File: "month_day_duration_test.flux", Source: "date.monthDay", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "month_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 37, }, File: "month_day_duration_test.flux", Source: "monthDay", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "monthDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "month_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.monthDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "month_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 34, }, File: "month_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 25, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "month_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 25, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 34, }, File: "month_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 31, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "month_day_duration_test.flux", Source: "_duration_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 39, }, File: "month_day_duration_test.flux", Source: "_duration_month_day", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_month_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "month_day_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 28, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "month_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "month_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "month_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "month_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "month_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "month_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "month_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "month_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "month_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "month_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "month_day_duration_test.flux", Source: "fn: t_duration_month_day", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "month_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_month_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 40, }, File: "month_day_duration_test.flux", Source: "test _duration_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_day_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 90, }, File: "month_day_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"\n\nt_time_month_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)})))\n\ntest _time_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "month_day_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "month_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_day_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "month_day_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "month_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "month_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 82, }, File: "month_day_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 46, }, File: "month_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 82, }, File: "month_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"", Start: ast.Position{ Column: 11, Line: 46, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 87, }, File: "month_day_time_test.flux", Source: "t_time_month_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 84, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 84, }, File: "month_day_time_test.flux", Source: "t_time_month_day", Start: ast.Position{ Column: 1, Line: 84, }, }, }, Name: "t_time_month_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 87, }, File: "month_day_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)})))", Start: ast.Position{ Column: 20, Line: 84, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 87, }, File: "month_day_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 85, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 85, }, File: "month_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 85, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 86, }, File: "month_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 85, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 86, }, File: "month_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 86, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 86, }, File: "month_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 86, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 86, }, File: "month_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 86, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 86, }, File: "month_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 86, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 86, }, File: "month_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 86, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 86, }, File: "month_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 86, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 87, }, File: "month_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 85, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 87, }, File: "month_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 87, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 87, }, File: "month_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 87, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 87, }, File: "month_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 87, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 87, }, File: "month_day_time_test.flux", Source: "(r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 14, Line: 87, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 87, }, File: "month_day_time_test.flux", Source: "({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 21, Line: 87, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 87, }, File: "month_day_time_test.flux", Source: "{r with _value: date.monthDay(t: r._time)}", Start: ast.Position{ Column: 22, Line: 87, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 87, }, File: "month_day_time_test.flux", Source: "_value: date.monthDay(t: r._time)", Start: ast.Position{ Column: 30, Line: 87, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 87, }, File: "month_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 87, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 87, }, File: "month_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 52, Line: 87, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 87, }, File: "month_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 52, Line: 87, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 87, }, File: "month_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 52, Line: 87, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 87, }, File: "month_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 55, Line: 87, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 87, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 55, Line: 87, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 87, }, File: "month_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 57, Line: 87, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 87, }, File: "month_day_time_test.flux", Source: "date.monthDay(t: r._time)", Start: ast.Position{ Column: 38, Line: 87, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 87, }, File: "month_day_time_test.flux", Source: "date.monthDay", Start: ast.Position{ Column: 38, Line: 87, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 87, }, File: "month_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 87, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 87, }, File: "month_day_time_test.flux", Source: "monthDay", Start: ast.Position{ Column: 43, Line: 87, }, }, }, Name: "monthDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 87, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 87, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 87, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 87, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 87, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 87, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 87, }, File: "month_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 87, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 87, }, File: "month_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 87, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 84, }, File: "month_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 21, Line: 84, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 84, }, File: "month_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 21, Line: 84, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 84, }, File: "month_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 27, Line: 84, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 90, }, File: "month_day_time_test.flux", Source: "_time_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 6, Line: 89, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 89, }, File: "month_day_time_test.flux", Source: "_time_month_day", Start: ast.Position{ Column: 6, Line: 89, }, }, }, Name: "_time_month_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 90, }, File: "month_day_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 24, Line: 89, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 90, }, File: "month_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 2, Line: 90, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 90, }, File: "month_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day}", Start: ast.Position{ Column: 3, Line: 90, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 90, }, File: "month_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 90, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 90, }, File: "month_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 90, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 90, }, File: "month_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 90, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 90, }, File: "month_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 90, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 90, }, File: "month_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 90, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 90, }, File: "month_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 90, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 90, }, File: "month_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 90, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 90, }, File: "month_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 90, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 90, }, File: "month_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 90, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 90, }, File: "month_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 90, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 90, }, File: "month_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 90, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 90, }, File: "month_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 90, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 90, }, File: "month_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 90, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 90, }, File: "month_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 90, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 90, }, File: "month_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 90, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 90, }, File: "month_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 90, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 90, }, File: "month_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 90, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 90, }, File: "month_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 90, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 90, }, File: "month_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 90, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 90, }, File: "month_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 90, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 90, }, File: "month_day_time_test.flux", Source: "fn: t_time_month_day", Start: ast.Position{ Column: 82, Line: 90, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 90, }, File: "month_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 90, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 90, }, File: "month_day_time_test.flux", Source: "t_time_month_day", Start: ast.Position{ Column: 86, Line: 90, }, }, }, Name: "t_time_month_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 90, }, File: "month_day_time_test.flux", Source: "test _time_month_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 1, Line: 89, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_day_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "month_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\n\nt_duration_month = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})))\n\ntest _duration_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "month_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "month_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "month_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "month_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "month_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "month_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "month_duration_test.flux", Source: "t_duration_month = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "month_duration_test.flux", Source: "t_duration_month", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_month", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "month_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})))", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "month_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "month_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "month_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "month_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "month_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "month_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "month_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "month_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_duration_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_duration_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "month_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_duration_test.flux", Source: "(r) => ({r with _value: date.month(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "month_duration_test.flux", Source: "({r with _value: date.month(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "month_duration_test.flux", Source: "{r with _value: date.month(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "month_duration_test.flux", Source: "_value: date.month(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "month_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "month_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 49, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "month_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 49, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "month_duration_test.flux", Source: "t", Start: ast.Position{ Column: 49, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "month_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 61, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "month_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 61, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 37, }, File: "month_duration_test.flux", Source: "v", Start: ast.Position{ Column: 61, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "month_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 65, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 37, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 65, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "month_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "month_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 52, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 37, }, File: "month_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 52, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "month_duration_test.flux", Source: "date.month(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 37, }, File: "month_duration_test.flux", Source: "date.month", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "month_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 37, }, File: "month_duration_test.flux", Source: "month", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "month", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "month_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.month(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "month_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 34, }, File: "month_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 34, }, File: "month_duration_test.flux", Source: "table", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 34, }, File: "month_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 27, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "month_duration_test.flux", Source: "_duration_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 39, }, File: "month_duration_test.flux", Source: "_duration_month", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_month", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "month_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 24, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "month_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "month_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "month_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "month_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "month_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "month_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "month_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "month_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "month_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "month_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "month_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "month_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "month_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "month_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "month_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "month_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "month_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "month_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "month_duration_test.flux", Source: "fn: t_duration_month", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "month_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "month_duration_test.flux", Source: "t_duration_month", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_month", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "month_duration_test.flux", Source: "test _duration_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "month_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"\n\nt_time_month = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: r._time)})))\n\ntest _time_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "month_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "month_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "month_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "month_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "month_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "month_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "month_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "month_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "month_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "month_time_test.flux", Source: "t_time_month = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 46, }, File: "month_time_test.flux", Source: "t_time_month", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_time_month", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "month_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: r._time)})))", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "month_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "month_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "month_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "month_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "month_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 48, }, File: "month_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "month_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "month_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 48, }, File: "month_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "month_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "month_time_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "month_time_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "month_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "month_time_test.flux", Source: "(r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 14, Line: 49, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "month_time_test.flux", Source: "({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 21, Line: 49, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "month_time_test.flux", Source: "{r with _value: date.month(t: r._time)}", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "month_time_test.flux", Source: "_value: date.month(t: r._time)", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 49, }, File: "month_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "month_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "month_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "month_time_test.flux", Source: "t", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "month_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 49, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "month_time_test.flux", Source: "_time", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "month_time_test.flux", Source: "date.month(t: r._time)", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "month_time_test.flux", Source: "date.month", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 49, }, File: "month_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "month_time_test.flux", Source: "month", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Name: "month", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 49, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "month_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 49, }, File: "month_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 46, }, File: "month_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 17, Line: 46, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 46, }, File: "month_time_test.flux", Source: "table", Start: ast.Position{ Column: 17, Line: 46, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 46, }, File: "month_time_test.flux", Source: "<-", Start: ast.Position{ Column: 23, Line: 46, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "month_time_test.flux", Source: "_time_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 51, }, File: "month_time_test.flux", Source: "_time_month", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_time_month", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "month_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 20, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "month_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "month_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "month_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "month_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "month_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "month_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "month_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "month_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "month_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "month_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "month_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "month_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "month_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "month_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "month_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "month_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "month_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "month_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "month_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "month_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "month_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "month_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "month_time_test.flux", Source: "fn: t_time_month", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "month_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "month_time_test.flux", Source: "t_time_month", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_time_month", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "month_time_test.flux", Source: "test _time_month = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "month_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "month_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"\n\nt_time_nanosecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})))\n\ntest _time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "nanosecond_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "nanosecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "nanosecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "nanosecond_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "nanosecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "nanosecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_time_nanosecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "nanosecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "(r) => ({r with _value: date.nanosecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "({r with _value: date.nanosecond(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "{r with _value: date.nanosecond(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "_value: date.nanosecond(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 70, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 70, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 72, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 57, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 57, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "date.nanosecond(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "date.nanosecond", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "nanosecond", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "nanosecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "_time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 39, }, File: "nanosecond_duration_test.flux", Source: "_time_nanosecond", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_time_nanosecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "fn: t_time_nanosecond", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_time_nanosecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "test _time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "nanosecond_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "nanosecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "nanosecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "nanosecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "nanosecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "nanosecond_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"\n\nt_time_nanosecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)})))\n\ntest _time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "nanosecond_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "nanosecond_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "nanosecond_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "nanosecond_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "nanosecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "nanosecond_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "nanosecond_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"", Start: ast.Position{ Column: 1, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 30, }, File: "nanosecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 30, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "nanosecond_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"", Start: ast.Position{ Column: 11, Line: 30, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 1, Line: 52, }, }, }, Name: "t_time_nanosecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "nanosecond_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)})))", Start: ast.Position{ Column: 21, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 55, }, File: "nanosecond_time_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 53, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 53, }, File: "nanosecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "nanosecond_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "nanosecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "nanosecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 54, }, File: "nanosecond_time_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 54, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 54, }, File: "nanosecond_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 54, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 54, }, File: "nanosecond_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 54, }, File: "nanosecond_time_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "nanosecond_time_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "nanosecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "nanosecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 55, }, File: "nanosecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "nanosecond_time_test.flux", Source: "(r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 14, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 55, }, File: "nanosecond_time_test.flux", Source: "({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 21, Line: 55, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "nanosecond_time_test.flux", Source: "{r with _value: date.nanosecond(t: r._time)}", Start: ast.Position{ Column: 22, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "nanosecond_time_test.flux", Source: "_value: date.nanosecond(t: r._time)", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 55, }, File: "nanosecond_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "nanosecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "nanosecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 55, }, File: "nanosecond_time_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 55, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "nanosecond_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 57, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 55, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 57, Line: 55, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "nanosecond_time_test.flux", Source: "_time", Start: ast.Position{ Column: 59, Line: 55, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "nanosecond_time_test.flux", Source: "date.nanosecond(t: r._time)", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 55, }, File: "nanosecond_time_test.flux", Source: "date.nanosecond", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 55, }, File: "nanosecond_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 55, }, File: "nanosecond_time_test.flux", Source: "nanosecond", Start: ast.Position{ Column: 43, Line: 55, }, }, }, Name: "nanosecond", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 55, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 55, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 55, }, File: "nanosecond_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 55, }, File: "nanosecond_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "nanosecond_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 52, }, File: "nanosecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 52, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "nanosecond_time_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 52, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "nanosecond_time_test.flux", Source: "_time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 6, Line: 57, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 57, }, File: "nanosecond_time_test.flux", Source: "_time_nanosecond", Start: ast.Position{ Column: 6, Line: 57, }, }, }, Name: "_time_nanosecond", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "nanosecond_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 25, Line: 57, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "nanosecond_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 2, Line: 58, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 58, }, File: "nanosecond_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond}", Start: ast.Position{ Column: 3, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "nanosecond_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 58, }, File: "nanosecond_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "nanosecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 58, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "nanosecond_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 58, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "nanosecond_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 58, }, File: "nanosecond_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 58, }, File: "nanosecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "nanosecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 58, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 58, }, File: "nanosecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "nanosecond_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 58, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "nanosecond_time_test.flux", Source: "fn: t_time_nanosecond", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 58, }, File: "nanosecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 86, Line: 58, }, }, }, Name: "t_time_nanosecond", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 58, }, File: "nanosecond_time_test.flux", Source: "test _time_nanosecond = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 1, Line: 57, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "nanosecond_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "nanosecond_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "nanosecond_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "nanosecond_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "nanosecond_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "quarter_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\n\nt_duration_quarter = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})))\n\ntest _duration_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "quarter_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "quarter_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "quarter_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "quarter_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "quarter_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "quarter_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "quarter_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "quarter_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 34, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_quarter", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "quarter_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})))", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "quarter_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "quarter_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "quarter_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "quarter_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "quarter_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "quarter_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "quarter_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "quarter_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "quarter_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "quarter_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "quarter_duration_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "quarter_duration_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "quarter_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "quarter_duration_test.flux", Source: "(r) => ({r with _value: date.quarter(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "quarter_duration_test.flux", Source: "({r with _value: date.quarter(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "quarter_duration_test.flux", Source: "{r with _value: date.quarter(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "quarter_duration_test.flux", Source: "_value: date.quarter(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "quarter_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "quarter_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "quarter_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 37, }, File: "quarter_duration_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "quarter_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "quarter_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 37, }, File: "quarter_duration_test.flux", Source: "v", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "quarter_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 37, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "quarter_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 69, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "quarter_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 37, }, File: "quarter_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "quarter_duration_test.flux", Source: "date.quarter(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "quarter_duration_test.flux", Source: "date.quarter", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "quarter_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "quarter_duration_test.flux", Source: "quarter", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "quarter", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "quarter_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.quarter(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "quarter_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 34, }, File: "quarter_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "quarter_duration_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 34, }, File: "quarter_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "quarter_duration_test.flux", Source: "_duration_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 39, }, File: "quarter_duration_test.flux", Source: "_duration_quarter", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_quarter", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "quarter_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 26, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "quarter_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "quarter_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "quarter_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "quarter_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "quarter_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "quarter_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "quarter_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "quarter_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "quarter_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "quarter_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "quarter_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "quarter_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "quarter_duration_test.flux", Source: "fn: t_duration_quarter", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "quarter_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_quarter", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "quarter_duration_test.flux", Source: "test _duration_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quarter_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quarter_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "quarter_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "quarter_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "quarter_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 52, }, File: "quarter_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"\n\nt_time_quarter = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: r._time)})))\n\ntest _time_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "quarter_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "quarter_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quarter_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quarter_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "quarter_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quarter_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "quarter_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "quarter_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "quarter_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 49, }, File: "quarter_time_test.flux", Source: "t_time_quarter = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 46, }, File: "quarter_time_test.flux", Source: "t_time_quarter", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_time_quarter", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 49, }, File: "quarter_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: r._time)})))", Start: ast.Position{ Column: 18, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 49, }, File: "quarter_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "quarter_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "quarter_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "quarter_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "quarter_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 48, }, File: "quarter_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "quarter_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "quarter_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 48, }, File: "quarter_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 49, }, File: "quarter_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "quarter_time_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "quarter_time_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "quarter_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "quarter_time_test.flux", Source: "(r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 14, Line: 49, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "quarter_time_test.flux", Source: "({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 21, Line: 49, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "quarter_time_test.flux", Source: "{r with _value: date.quarter(t: r._time)}", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "quarter_time_test.flux", Source: "_value: date.quarter(t: r._time)", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 49, }, File: "quarter_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "quarter_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "quarter_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 49, }, File: "quarter_time_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 49, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "quarter_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 49, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "quarter_time_test.flux", Source: "_time", Start: ast.Position{ Column: 56, Line: 49, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "quarter_time_test.flux", Source: "date.quarter(t: r._time)", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "quarter_time_test.flux", Source: "date.quarter", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 49, }, File: "quarter_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "quarter_time_test.flux", Source: "quarter", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Name: "quarter", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 49, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 49, }, File: "quarter_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 49, }, File: "quarter_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 46, }, File: "quarter_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 46, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "quarter_time_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 46, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 46, }, File: "quarter_time_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 46, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 52, }, File: "quarter_time_test.flux", Source: "_time_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 51, }, File: "quarter_time_test.flux", Source: "_time_quarter", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_time_quarter", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 52, }, File: "quarter_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 22, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 52, }, File: "quarter_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 52, }, File: "quarter_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "quarter_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "quarter_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "quarter_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "quarter_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "quarter_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "quarter_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "quarter_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "quarter_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "quarter_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "quarter_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "quarter_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "quarter_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "quarter_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "quarter_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "quarter_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "quarter_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "quarter_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "quarter_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "quarter_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "quarter_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "quarter_time_test.flux", Source: "fn: t_time_quarter", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "quarter_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "quarter_time_test.flux", Source: "t_time_quarter", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_time_quarter", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 52, }, File: "quarter_time_test.flux", Source: "test _time_quarter = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quarter_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quarter_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "quarter_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "quarter_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "quarter_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "second_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\n\nt_duration_second = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})))\n\ntest _duration_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "second_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "second_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "second_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "second_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "second_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "second_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "second_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "second_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "second_duration_test.flux", Source: "t_duration_second = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 34, }, File: "second_duration_test.flux", Source: "t_duration_second", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_second", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "second_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})))", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "second_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "second_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "second_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "second_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "second_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "second_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "second_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "second_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "second_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "second_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "second_duration_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "second_duration_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "second_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "second_duration_test.flux", Source: "(r) => ({r with _value: date.second(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "second_duration_test.flux", Source: "({r with _value: date.second(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "second_duration_test.flux", Source: "{r with _value: date.second(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "second_duration_test.flux", Source: "_value: date.second(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "second_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "second_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "second_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 37, }, File: "second_duration_test.flux", Source: "t", Start: ast.Position{ Column: 50, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "second_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "second_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 37, }, File: "second_duration_test.flux", Source: "v", Start: ast.Position{ Column: 62, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "second_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 37, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "second_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 68, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "second_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 53, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 37, }, File: "second_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 53, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "second_duration_test.flux", Source: "date.second(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "second_duration_test.flux", Source: "date.second", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "second_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "second_duration_test.flux", Source: "second", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "second", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "second_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.second(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "second_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "second_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 34, }, File: "second_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "second_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "second_duration_test.flux", Source: "_duration_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 39, }, File: "second_duration_test.flux", Source: "_duration_second", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_second", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "second_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "second_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 40, }, File: "second_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "second_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "second_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "second_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "second_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "second_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "second_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "second_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "second_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "second_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "second_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "second_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "second_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "second_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "second_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "second_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "second_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "second_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "second_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "second_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "second_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "second_duration_test.flux", Source: "fn: t_duration_second", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "second_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "second_duration_test.flux", Source: "t_duration_second", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_second", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "second_duration_test.flux", Source: "test _duration_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "second_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "second_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "second_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "second_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "second_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "second_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"\n\nt_time_second = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: r._time)})))\n\ntest _time_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "second_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "second_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "second_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 35, }, File: "second_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "second_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 35, }, File: "second_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 64, }, File: "second_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 37, }, File: "second_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 64, }, File: "second_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "second_time_test.flux", Source: "t_time_second = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 66, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 66, }, File: "second_time_test.flux", Source: "t_time_second", Start: ast.Position{ Column: 1, Line: 66, }, }, }, Name: "t_time_second", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "second_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: r._time)})))", Start: ast.Position{ Column: 17, Line: 66, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 69, }, File: "second_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 67, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 67, }, File: "second_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 68, }, File: "second_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 68, }, File: "second_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 68, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 68, }, File: "second_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 68, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 68, }, File: "second_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 68, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 68, }, File: "second_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 68, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 68, }, File: "second_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 68, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 68, }, File: "second_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 68, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 69, }, File: "second_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 67, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "second_time_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "second_time_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 69, }, File: "second_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 69, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "second_time_test.flux", Source: "(r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 14, Line: 69, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 69, }, File: "second_time_test.flux", Source: "({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 21, Line: 69, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 69, }, File: "second_time_test.flux", Source: "{r with _value: date.second(t: r._time)}", Start: ast.Position{ Column: 22, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 69, }, File: "second_time_test.flux", Source: "_value: date.second(t: r._time)", Start: ast.Position{ Column: 30, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 69, }, File: "second_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 69, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "second_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "second_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 69, }, File: "second_time_test.flux", Source: "t", Start: ast.Position{ Column: 50, Line: 69, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "second_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 53, Line: 69, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 69, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 53, Line: 69, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 69, }, File: "second_time_test.flux", Source: "_time", Start: ast.Position{ Column: 55, Line: 69, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 69, }, File: "second_time_test.flux", Source: "date.second(t: r._time)", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 69, }, File: "second_time_test.flux", Source: "date.second", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 69, }, File: "second_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 69, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 69, }, File: "second_time_test.flux", Source: "second", Start: ast.Position{ Column: 43, Line: 69, }, }, }, Name: "second", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 69, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 69, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 69, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 69, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 69, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 69, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 69, }, File: "second_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 69, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 69, }, File: "second_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 69, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 66, }, File: "second_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 66, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 66, }, File: "second_time_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 66, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 66, }, File: "second_time_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 66, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "second_time_test.flux", Source: "_time_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 6, Line: 71, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 71, }, File: "second_time_test.flux", Source: "_time_second", Start: ast.Position{ Column: 6, Line: 71, }, }, }, Name: "_time_second", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "second_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 21, Line: 71, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "second_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 2, Line: 72, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 72, }, File: "second_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second}", Start: ast.Position{ Column: 3, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "second_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 72, }, File: "second_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 72, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "second_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "second_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 72, }, File: "second_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 72, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 72, }, File: "second_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 72, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 72, }, File: "second_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 72, }, File: "second_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 72, }, File: "second_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 72, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 72, }, File: "second_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 72, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 72, }, File: "second_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 72, }, File: "second_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 72, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "second_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "second_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 72, }, File: "second_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 72, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 72, }, File: "second_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 72, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 72, }, File: "second_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 72, }, File: "second_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 72, }, File: "second_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 72, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 72, }, File: "second_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 72, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 72, }, File: "second_time_test.flux", Source: "fn: t_time_second", Start: ast.Position{ Column: 82, Line: 72, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 72, }, File: "second_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 72, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 72, }, File: "second_time_test.flux", Source: "t_time_second", Start: ast.Position{ Column: 86, Line: 72, }, }, }, Name: "t_time_second", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 72, }, File: "second_time_test.flux", Source: "test _time_second = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 1, Line: 71, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "second_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "second_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "second_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "second_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "second_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 43, }, File: "truncate_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n\"\n\noutData = \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"\n\nt_duration_truncate = (table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})))\n\ntest _duration_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "truncate_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "truncate_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 20, }, File: "truncate_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "truncate_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 20, }, File: "truncate_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "truncate_duration_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "truncate_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "truncate_duration_test.flux", Source: "\"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"", Start: ast.Position{ Column: 11, Line: 22, }, }, }, Value: "\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 40, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate = (table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})))", Start: ast.Position{ Column: 1, Line: 36, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 36, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate", Start: ast.Position{ Column: 1, Line: 36, }, }, }, Name: "t_duration_truncate", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 40, }, File: "truncate_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})))", Start: ast.Position{ Column: 23, Line: 36, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 40, }, File: "truncate_duration_test.flux", Source: "(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})))", Start: ast.Position{ Column: 2, Line: 37, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 37, }, File: "truncate_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 37, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "truncate_duration_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)", Start: ast.Position{ Column: 3, Line: 37, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 38, }, File: "truncate_duration_test.flux", Source: "start: 2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 15, Line: 38, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 38, }, File: "truncate_duration_test.flux", Source: "start: 2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 15, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 38, }, File: "truncate_duration_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 38, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 38, }, File: "truncate_duration_test.flux", Source: "2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 22, Line: 38, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "truncate_duration_test.flux", Source: "range(start: 2018-05-22T19:53:00.000000000Z)", Start: ast.Position{ Column: 9, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 38, }, File: "truncate_duration_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 38, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 39, }, File: "truncate_duration_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 37, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "truncate_duration_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "truncate_duration_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 39, }, File: "truncate_duration_test.flux", Source: "columns", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "truncate_duration_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 23, Line: 39, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 39, }, File: "truncate_duration_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 24, Line: 39, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 39, }, File: "truncate_duration_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 34, Line: 39, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 39, }, File: "truncate_duration_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 9, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 39, }, File: "truncate_duration_test.flux", Source: "drop", Start: ast.Position{ Column: 9, Line: 39, }, }, }, Name: "drop", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 40, }, File: "truncate_duration_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n\t |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", Start: ast.Position{ Column: 3, Line: 37, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 40, }, File: "truncate_duration_test.flux", Source: "fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 10, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 40, }, File: "truncate_duration_test.flux", Source: "fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 10, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 40, }, File: "truncate_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 40, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 40, }, File: "truncate_duration_test.flux", Source: "(r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 14, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 40, }, File: "truncate_duration_test.flux", Source: "({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 21, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 40, }, File: "truncate_duration_test.flux", Source: "{r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}", Start: ast.Position{ Column: 22, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 40, }, File: "truncate_duration_test.flux", Source: "_value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))", Start: ast.Position{ Column: 30, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "truncate_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 40, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 94, Line: 40, }, File: "truncate_duration_test.flux", Source: "v: date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 42, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 94, Line: 40, }, File: "truncate_duration_test.flux", Source: "v: date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 42, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "truncate_duration_test.flux", Source: "v", Start: ast.Position{ Column: 42, Line: 40, }, }, }, Name: "v", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 93, Line: 40, }, File: "truncate_duration_test.flux", Source: "t: duration(v: r._value), unit: 1s", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 40, }, File: "truncate_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 40, }, File: "truncate_duration_test.flux", Source: "t", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 40, }, File: "truncate_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 71, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 40, }, File: "truncate_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 71, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 40, }, File: "truncate_duration_test.flux", Source: "v", Start: ast.Position{ Column: 71, Line: 40, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 40, }, File: "truncate_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 74, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 40, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 74, Line: 40, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 40, }, File: "truncate_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 76, Line: 40, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 40, }, File: "truncate_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 62, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "truncate_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 62, Line: 40, }, }, }, Name: "duration", }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 93, Line: 40, }, File: "truncate_duration_test.flux", Source: "unit: 1s", Start: ast.Position{ Column: 85, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 40, }, File: "truncate_duration_test.flux", Source: "unit", Start: ast.Position{ Column: 85, Line: 40, }, }, }, Name: "unit", }, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 93, Line: 40, }, File: "truncate_duration_test.flux", Source: "1s", Start: ast.Position{ Column: 91, Line: 40, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "s", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 94, Line: 40, }, File: "truncate_duration_test.flux", Source: "date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "truncate_duration_test.flux", Source: "date.truncate", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "truncate_duration_test.flux", Source: "date", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "truncate_duration_test.flux", Source: "truncate", Start: ast.Position{ Column: 50, Line: 40, }, }, }, Name: "truncate", }, }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 40, }, File: "truncate_duration_test.flux", Source: "int(v: date.truncate(t: duration(v: r._value), unit: 1s))", Start: ast.Position{ Column: 38, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 40, }, File: "truncate_duration_test.flux", Source: "int", Start: ast.Position{ Column: 38, Line: 40, }, }, }, Name: "int", }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 40, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 40, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 40, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 40, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 40, }, File: "truncate_duration_test.flux", Source: "map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "truncate_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 36, }, File: "truncate_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 36, }, File: "truncate_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 36, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 36, }, File: "truncate_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 36, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 43, }, File: "truncate_duration_test.flux", Source: "_duration_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 6, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 42, }, File: "truncate_duration_test.flux", Source: "_duration_truncate", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "_duration_truncate", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 43, }, File: "truncate_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 27, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 43, }, File: "truncate_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 2, Line: 43, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 43, }, File: "truncate_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate}", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 43, }, File: "truncate_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 43, }, File: "truncate_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 43, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "truncate_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 43, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 43, }, File: "truncate_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 43, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 43, }, File: "truncate_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 43, }, File: "truncate_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 43, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 43, }, File: "truncate_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "truncate_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 43, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 43, }, File: "truncate_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 43, }, File: "truncate_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 43, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "truncate_duration_test.flux", Source: "fn: t_duration_truncate", Start: ast.Position{ Column: 82, Line: 43, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 43, }, File: "truncate_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 43, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate", Start: ast.Position{ Column: 86, Line: 43, }, }, }, Name: "t_duration_truncate", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 43, }, File: "truncate_duration_test.flux", Source: "test _duration_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 1, Line: 42, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "truncate_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "truncate_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "truncate_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "truncate_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "truncate_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n\"\n\noutData = \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"\n\nt_time_truncate = (table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})))\n\ntest _time_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "truncate_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "truncate_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "truncate_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "truncate_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "truncate_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "truncate_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "truncate_time_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "truncate_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "truncate_time_test.flux", Source: "\"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 38, }, File: "truncate_time_test.flux", Source: "t_time_truncate = (table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 34, }, File: "truncate_time_test.flux", Source: "t_time_truncate", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_time_truncate", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 38, }, File: "truncate_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})))", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 38, }, File: "truncate_time_test.flux", Source: "(table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "truncate_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 36, }, File: "truncate_time_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 36, }, File: "truncate_time_test.flux", Source: "start: 2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 15, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 36, }, File: "truncate_time_test.flux", Source: "start: 2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 15, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 36, }, File: "truncate_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 36, }, File: "truncate_time_test.flux", Source: "2018-05-22T19:53:00.000000000Z", Start: ast.Position{ Column: 22, Line: 36, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 36, }, File: "truncate_time_test.flux", Source: "range(start: 2018-05-22T19:53:00.000000000Z)", Start: ast.Position{ Column: 9, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 36, }, File: "truncate_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "truncate_time_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "truncate_time_test.flux", Source: "columns", Start: ast.Position{ Column: 17, Line: 37, }, }, }, Name: "columns", }, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 26, Line: 37, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 37, }, File: "truncate_time_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 27, Line: 37, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 37, }, File: "truncate_time_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 37, Line: 37, }, }, }, Value: "_stop", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "truncate_time_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "truncate_time_test.flux", Source: "drop", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "drop", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 38, }, File: "truncate_time_test.flux", Source: "table\n\t |> range(start: 2018-05-22T19:53:00.000000000Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "truncate_time_test.flux", Source: "fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 10, Line: 38, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "truncate_time_test.flux", Source: "fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 10, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 38, }, File: "truncate_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 38, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "truncate_time_test.flux", Source: "(r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 14, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "truncate_time_test.flux", Source: "({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 38, }, File: "truncate_time_test.flux", Source: "{r with _time: date.truncate(t: r._time, unit: 1h)}", Start: ast.Position{ Column: 22, Line: 38, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "truncate_time_test.flux", Source: "_time: date.truncate(t: r._time, unit: 1h)", Start: ast.Position{ Column: 30, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 38, }, File: "truncate_time_test.flux", Source: "_time", Start: ast.Position{ Column: 30, Line: 38, }, }, }, Name: "_time", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "truncate_time_test.flux", Source: "t: r._time, unit: 1h", Start: ast.Position{ Column: 51, Line: 38, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "truncate_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 38, }, File: "truncate_time_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 38, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "truncate_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "truncate_time_test.flux", Source: "_time", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Name: "_time", }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "truncate_time_test.flux", Source: "unit: 1h", Start: ast.Position{ Column: 63, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "truncate_time_test.flux", Source: "unit", Start: ast.Position{ Column: 63, Line: 38, }, }, }, Name: "unit", }, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "truncate_time_test.flux", Source: "1h", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "h", }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "truncate_time_test.flux", Source: "date.truncate(t: r._time, unit: 1h)", Start: ast.Position{ Column: 37, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 38, }, File: "truncate_time_test.flux", Source: "date.truncate", Start: ast.Position{ Column: 37, Line: 38, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 38, }, File: "truncate_time_test.flux", Source: "date", Start: ast.Position{ Column: 37, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 38, }, File: "truncate_time_test.flux", Source: "truncate", Start: ast.Position{ Column: 42, Line: 38, }, }, }, Name: "truncate", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 38, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 38, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 38, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 38, }, File: "truncate_time_test.flux", Source: "map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 38, }, File: "truncate_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "truncate_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 34, }, File: "truncate_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "truncate_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_time_test.flux", Source: "_time_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "truncate_time_test.flux", Source: "_time_truncate", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_time_truncate", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "truncate_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "truncate_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "truncate_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "truncate_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "truncate_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "truncate_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "truncate_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "truncate_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "truncate_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "truncate_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "truncate_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "truncate_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "truncate_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "truncate_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "truncate_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "truncate_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "truncate_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "truncate_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "truncate_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "truncate_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "truncate_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "truncate_time_test.flux", Source: "fn: t_time_truncate", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "truncate_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "truncate_time_test.flux", Source: "t_time_truncate", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_time_truncate", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_time_test.flux", Source: "test _time_truncate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "truncate_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "truncate_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "truncate_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "truncate_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "truncate_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "week_day_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"\n\nt_duration_week_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})))\n\ntest _duration_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "week_day_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "week_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "week_day_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "week_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "week_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "week_day_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "week_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "week_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 34, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_week_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "week_day_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 23, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "week_day_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "week_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "week_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "week_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "week_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "week_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "week_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "week_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "week_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "week_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "week_day_duration_test.flux", Source: "(r) => ({r with _value: date.weekDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "week_day_duration_test.flux", Source: "({r with _value: date.weekDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "week_day_duration_test.flux", Source: "{r with _value: date.weekDay(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "week_day_duration_test.flux", Source: "_value: date.weekDay(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "week_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 37, }, File: "week_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "week_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "week_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 37, }, File: "week_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "week_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 37, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "week_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 69, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_day_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 37, }, File: "week_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "week_day_duration_test.flux", Source: "date.weekDay(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "week_day_duration_test.flux", Source: "date.weekDay", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "week_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "week_day_duration_test.flux", Source: "weekDay", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "weekDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "week_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.weekDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "week_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "week_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 34, }, File: "week_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "week_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "week_day_duration_test.flux", Source: "_duration_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 39, }, File: "week_day_duration_test.flux", Source: "_duration_week_day", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_week_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "week_day_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 27, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "week_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "week_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "week_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "week_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "week_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "week_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "week_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "week_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "week_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "week_day_duration_test.flux", Source: "fn: t_duration_week_day", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "week_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_week_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "week_day_duration_test.flux", Source: "test _duration_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_day_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 44, }, File: "week_day_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"\n\nt_time_week_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)})))\n\ntest _time_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "week_day_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "week_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_day_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "week_day_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "week_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "week_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "week_day_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"", Start: ast.Position{ Column: 1, Line: 23, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 23, }, File: "week_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 23, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "week_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"", Start: ast.Position{ Column: 11, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "week_day_time_test.flux", Source: "t_time_week_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "week_day_time_test.flux", Source: "t_time_week_day", Start: ast.Position{ Column: 1, Line: 38, }, }, }, Name: "t_time_week_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "week_day_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)})))", Start: ast.Position{ Column: 19, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "week_day_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 39, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 39, }, File: "week_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "week_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 40, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 40, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 40, }, File: "week_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 40, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 41, }, File: "week_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "week_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "week_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "week_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 41, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "week_day_time_test.flux", Source: "(r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "week_day_time_test.flux", Source: "({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 21, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 41, }, File: "week_day_time_test.flux", Source: "{r with _value: date.weekDay(t: r._time)}", Start: ast.Position{ Column: 22, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 41, }, File: "week_day_time_test.flux", Source: "_value: date.weekDay(t: r._time)", Start: ast.Position{ Column: 30, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 41, }, File: "week_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 41, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "week_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 41, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 56, Line: 41, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 41, }, File: "week_day_time_test.flux", Source: "date.weekDay(t: r._time)", Start: ast.Position{ Column: 38, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 41, }, File: "week_day_time_test.flux", Source: "date.weekDay", Start: ast.Position{ Column: 38, Line: 41, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "week_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 41, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 41, }, File: "week_day_time_test.flux", Source: "weekDay", Start: ast.Position{ Column: 43, Line: 41, }, }, }, Name: "weekDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 41, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 41, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 41, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 41, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 41, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 41, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 41, }, File: "week_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "week_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 38, }, File: "week_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 38, }, File: "week_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 38, }, File: "week_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 38, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 44, }, File: "week_day_time_test.flux", Source: "_time_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 6, Line: 43, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 43, }, File: "week_day_time_test.flux", Source: "_time_week_day", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Name: "_time_week_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 44, }, File: "week_day_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 23, Line: 43, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 44, }, File: "week_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 2, Line: 44, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 44, }, File: "week_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day}", Start: ast.Position{ Column: 3, Line: 44, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 44, }, File: "week_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 44, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 44, }, File: "week_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 44, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 44, }, File: "week_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 44, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 44, }, File: "week_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 44, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 44, }, File: "week_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 44, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 44, }, File: "week_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 44, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 44, }, File: "week_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 44, }, File: "week_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 44, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 44, }, File: "week_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 44, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 44, }, File: "week_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 44, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 44, }, File: "week_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 44, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 44, }, File: "week_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 44, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 44, }, File: "week_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 44, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 44, }, File: "week_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 44, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 44, }, File: "week_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 44, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 44, }, File: "week_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 44, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 44, }, File: "week_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 44, }, File: "week_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 44, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 44, }, File: "week_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 44, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 44, }, File: "week_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 44, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 44, }, File: "week_day_time_test.flux", Source: "fn: t_time_week_day", Start: ast.Position{ Column: 82, Line: 44, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 44, }, File: "week_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 44, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 44, }, File: "week_day_time_test.flux", Source: "t_time_week_day", Start: ast.Position{ Column: 86, Line: 44, }, }, }, Name: "t_time_week_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 44, }, File: "week_day_time_test.flux", Source: "test _time_week_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 1, Line: 43, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_day_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "week_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\n\nt_duration_week = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})))\n\ntest _duration_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "week_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "week_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "week_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "week_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "week_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "week_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "week_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "week_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "week_duration_test.flux", Source: "t_duration_week = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 34, }, File: "week_duration_test.flux", Source: "t_duration_week", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_week", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "week_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})))", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "week_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "week_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "week_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "week_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "week_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "week_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "week_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "week_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_duration_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_duration_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "week_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_duration_test.flux", Source: "(r) => ({r with _value: date.week(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "week_duration_test.flux", Source: "({r with _value: date.week(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "week_duration_test.flux", Source: "{r with _value: date.week(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "week_duration_test.flux", Source: "_value: date.week(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "week_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "week_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "week_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "week_duration_test.flux", Source: "t", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "week_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "week_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 37, }, File: "week_duration_test.flux", Source: "v", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "week_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 37, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "week_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "week_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 37, }, File: "week_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "week_duration_test.flux", Source: "date.week(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "week_duration_test.flux", Source: "date.week", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "week_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "week_duration_test.flux", Source: "week", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "week", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "week_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.week(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "week_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "week_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 34, }, File: "week_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "week_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "week_duration_test.flux", Source: "_duration_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 39, }, File: "week_duration_test.flux", Source: "_duration_week", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_week", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "week_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 23, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "week_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "week_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "week_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "week_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "week_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "week_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "week_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "week_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "week_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "week_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "week_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "week_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "week_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "week_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "week_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "week_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "week_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "week_duration_test.flux", Source: "fn: t_duration_week", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "week_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "week_duration_test.flux", Source: "t_duration_week", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_week", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "week_duration_test.flux", Source: "test _duration_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "week_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"\n\nt_time_week = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: r._time)})))\n\ntest _time_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "week_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "week_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "week_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "week_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "week_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "week_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "week_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "week_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "week_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "week_time_test.flux", Source: "t_time_week = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 46, }, File: "week_time_test.flux", Source: "t_time_week", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_time_week", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "week_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: r._time)})))", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "week_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "week_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "week_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "week_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "week_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 48, }, File: "week_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 48, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "week_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 48, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "week_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 48, }, File: "week_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "week_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "week_time_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "week_time_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "week_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 49, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "week_time_test.flux", Source: "(r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 14, Line: 49, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "week_time_test.flux", Source: "({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 21, Line: 49, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "week_time_test.flux", Source: "{r with _value: date.week(t: r._time)}", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "week_time_test.flux", Source: "_value: date.week(t: r._time)", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 49, }, File: "week_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "week_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 48, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "week_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 48, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 49, }, File: "week_time_test.flux", Source: "t", Start: ast.Position{ Column: 48, Line: 49, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "week_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 51, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 49, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 51, Line: 49, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 49, }, File: "week_time_test.flux", Source: "_time", Start: ast.Position{ Column: 53, Line: 49, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "week_time_test.flux", Source: "date.week(t: r._time)", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 49, }, File: "week_time_test.flux", Source: "date.week", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 49, }, File: "week_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 49, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 49, }, File: "week_time_test.flux", Source: "week", Start: ast.Position{ Column: 43, Line: 49, }, }, }, Name: "week", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 49, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 49, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 49, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "week_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 49, }, File: "week_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "week_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 46, }, File: "week_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "week_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 46, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "week_time_test.flux", Source: "_time_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 51, }, File: "week_time_test.flux", Source: "_time_week", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_time_week", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "week_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 19, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "week_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "week_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "week_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "week_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "week_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "week_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "week_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "week_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "week_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "week_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "week_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "week_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "week_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "week_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "week_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "week_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "week_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "week_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "week_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "week_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "week_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "week_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 52, }, File: "week_time_test.flux", Source: "fn: t_time_week", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "week_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 52, }, File: "week_time_test.flux", Source: "t_time_week", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_time_week", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "week_time_test.flux", Source: "test _time_week = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "week_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "week_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "year_day_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\n\nt_duration_year_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})))\n\ntest _duration_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "year_day_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "year_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_day_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "year_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "year_day_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "year_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "year_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 34, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_year_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "year_day_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 23, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 37, }, File: "year_day_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "year_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "year_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "year_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "year_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "year_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "year_day_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "year_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "year_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "year_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "year_day_duration_test.flux", Source: "(r) => ({r with _value: date.yearDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 37, }, File: "year_day_duration_test.flux", Source: "({r with _value: date.yearDay(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "year_day_duration_test.flux", Source: "{r with _value: date.yearDay(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "year_day_duration_test.flux", Source: "_value: date.yearDay(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "year_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_day_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 37, }, File: "year_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "year_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "year_day_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 37, }, File: "year_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 63, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "year_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 37, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 67, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "year_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 69, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_day_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 37, }, File: "year_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 54, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "year_day_duration_test.flux", Source: "date.yearDay(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "year_day_duration_test.flux", Source: "date.yearDay", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "year_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 37, }, File: "year_day_duration_test.flux", Source: "yearDay", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "yearDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 37, }, File: "year_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.yearDay(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "year_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "year_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 34, }, File: "year_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 34, }, File: "year_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "year_day_duration_test.flux", Source: "_duration_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 39, }, File: "year_day_duration_test.flux", Source: "_duration_year_day", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_year_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "year_day_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 27, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "year_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 40, }, File: "year_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "year_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "year_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "year_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "year_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "year_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "year_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "year_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "year_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "year_day_duration_test.flux", Source: "fn: t_duration_year_day", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "year_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 40, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_year_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 40, }, File: "year_day_duration_test.flux", Source: "test _duration_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_day_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "year_day_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"\n\nt_time_year_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)})))\n\ntest _time_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "year_day_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "year_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_day_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "year_day_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "year_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 28, }, File: "year_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "year_day_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"", Start: ast.Position{ Column: 1, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 30, }, File: "year_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 30, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "year_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"", Start: ast.Position{ Column: 11, Line: 30, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "year_day_time_test.flux", Source: "t_time_year_day = (table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 52, }, File: "year_day_time_test.flux", Source: "t_time_year_day", Start: ast.Position{ Column: 1, Line: 52, }, }, }, Name: "t_time_year_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "year_day_time_test.flux", Source: "(table=<-) =>\n\t(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)})))", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 55, }, File: "year_day_time_test.flux", Source: "(table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 53, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 53, }, File: "year_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 54, }, File: "year_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 54, }, File: "year_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 54, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 54, }, File: "year_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 15, Line: 54, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 54, }, File: "year_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 15, Line: 54, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 54, }, File: "year_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 22, Line: 54, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 54, }, File: "year_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 9, Line: 54, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 54, }, File: "year_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 9, Line: 54, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "year_day_time_test.flux", Source: "table\n\t |> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 53, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "year_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "year_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 55, }, File: "year_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 55, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "year_day_time_test.flux", Source: "(r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 14, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 55, }, File: "year_day_time_test.flux", Source: "({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 21, Line: 55, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 55, }, File: "year_day_time_test.flux", Source: "{r with _value: date.yearDay(t: r._time)}", Start: ast.Position{ Column: 22, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 55, }, File: "year_day_time_test.flux", Source: "_value: date.yearDay(t: r._time)", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 55, }, File: "year_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 55, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 55, }, File: "year_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 55, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 55, }, File: "year_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 51, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 55, }, File: "year_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 51, Line: 55, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 55, }, File: "year_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 54, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 55, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 54, Line: 55, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 55, }, File: "year_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 56, Line: 55, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 55, }, File: "year_day_time_test.flux", Source: "date.yearDay(t: r._time)", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 55, }, File: "year_day_time_test.flux", Source: "date.yearDay", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 55, }, File: "year_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 55, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 55, }, File: "year_day_time_test.flux", Source: "yearDay", Start: ast.Position{ Column: 43, Line: 55, }, }, }, Name: "yearDay", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 55, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 55, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 55, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 55, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 55, }, File: "year_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 55, }, File: "year_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 52, }, File: "year_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 52, }, File: "year_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 52, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 52, }, File: "year_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 52, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "year_day_time_test.flux", Source: "_time_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 6, Line: 57, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 57, }, File: "year_day_time_test.flux", Source: "_time_year_day", Start: ast.Position{ Column: 6, Line: 57, }, }, }, Name: "_time_year_day", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "year_day_time_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 23, Line: 57, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "year_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 2, Line: 58, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 58, }, File: "year_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day}", Start: ast.Position{ Column: 3, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "year_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 58, }, File: "year_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 58, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "year_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "year_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 58, }, File: "year_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 58, }, File: "year_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 58, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 58, }, File: "year_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "year_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 58, }, File: "year_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 58, }, File: "year_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 58, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "year_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 58, }, File: "year_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 58, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "year_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "year_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 58, }, File: "year_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 58, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 58, }, File: "year_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 58, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 58, }, File: "year_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "year_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 58, }, File: "year_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 58, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 58, }, File: "year_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 58, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 58, }, File: "year_day_time_test.flux", Source: "fn: t_time_year_day", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 58, }, File: "year_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 58, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 58, }, File: "year_day_time_test.flux", Source: "t_time_year_day", Start: ast.Position{ Column: 86, Line: 58, }, }, }, Name: "t_time_year_day", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 58, }, File: "year_day_time_test.flux", Source: "test _time_year_day = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 1, Line: 57, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_day_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "year_duration_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"\n\nt_duration_year = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})))\n\ntest _duration_year = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_duration_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "year_duration_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_duration_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_duration_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "year_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_duration_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_duration_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "year_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "year_duration_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "year_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "year_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "year_duration_test.flux", Source: "t_duration_year = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 34, }, File: "year_duration_test.flux", Source: "t_duration_year", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_duration_year", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "year_duration_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})))", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 37, }, File: "year_duration_test.flux", Source: "(table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "year_duration_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "year_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "year_duration_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "year_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "year_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "year_duration_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "year_duration_test.flux", Source: "table\n\t\t|> range(start: 2018-01-01T00:00:00Z)\n\t\t|> map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_duration_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_duration_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: duration(v : r._value))})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "year_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_duration_test.flux", Source: "(r) => ({r with _value: date.year(t: duration(v : r._value))})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 37, }, File: "year_duration_test.flux", Source: "({r with _value: date.year(t: duration(v : r._value))})", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 37, }, File: "year_duration_test.flux", Source: "{r with _value: date.year(t: duration(v : r._value))}", Start: ast.Position{ Column: 22, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "year_duration_test.flux", Source: "_value: date.year(t: duration(v : r._value))", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 37, }, File: "year_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 30, Line: 37, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "year_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "year_duration_test.flux", Source: "t: duration(v : r._value)", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 37, }, File: "year_duration_test.flux", Source: "t", Start: ast.Position{ Column: 48, Line: 37, }, }, }, Name: "t", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "year_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "year_duration_test.flux", Source: "v : r._value", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 37, }, File: "year_duration_test.flux", Source: "v", Start: ast.Position{ Column: 60, Line: 37, }, }, }, Name: "v", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "year_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 37, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 64, Line: 37, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 37, }, File: "year_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 66, Line: 37, }, }, }, Name: "_value", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 37, }, File: "year_duration_test.flux", Source: "duration(v : r._value)", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 37, }, File: "year_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 51, Line: 37, }, }, }, Name: "duration", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 37, }, File: "year_duration_test.flux", Source: "date.year(t: duration(v : r._value))", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "year_duration_test.flux", Source: "date.year", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 37, }, File: "year_duration_test.flux", Source: "date", Start: ast.Position{ Column: 38, Line: 37, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 37, }, File: "year_duration_test.flux", Source: "year", Start: ast.Position{ Column: 43, Line: 37, }, }, }, Name: "year", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 37, }, File: "year_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.year(t: duration(v : r._value))}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "year_duration_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "year_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 34, }, File: "year_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 34, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 34, }, File: "year_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 34, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "year_duration_test.flux", Source: "_duration_year = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 39, }, File: "year_duration_test.flux", Source: "_duration_year", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_duration_year", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "year_duration_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 23, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "year_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "year_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "year_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "year_duration_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "year_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "year_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "year_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "year_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "year_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "year_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "year_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "year_duration_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "year_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "year_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "year_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "year_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "year_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "year_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "year_duration_test.flux", Source: "fn: t_duration_year", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "year_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "year_duration_test.flux", Source: "t_duration_year", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_duration_year", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 40, }, File: "year_duration_test.flux", Source: "test _duration_year = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_duration_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_duration_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "year_time_test.flux", Source: "package date_test\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n\"\n\noutData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"\n\nt_time_year = (table=<-) =>\n\t(table\n \t |> range(start: 2018-01-01T00:00:00Z)\n \t\t|> map(fn: (r) => ({r with _value: date.year(t: r._time)})))\n\n test _time_year = () =>\n \t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_time_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "year_time_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_time_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_time_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "year_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "year_time_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "year_time_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "year_time_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "year_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "year_time_test.flux", Source: "outData = \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "year_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 44, }, File: "year_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "year_time_test.flux", Source: "t_time_year = (table=<-) =>\n\t(table\n \t |> range(start: 2018-01-01T00:00:00Z)\n \t\t|> map(fn: (r) => ({r with _value: date.year(t: r._time)})))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 46, }, File: "year_time_test.flux", Source: "t_time_year", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_time_year", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "year_time_test.flux", Source: "(table=<-) =>\n\t(table\n \t |> range(start: 2018-01-01T00:00:00Z)\n \t\t|> map(fn: (r) => ({r with _value: date.year(t: r._time)})))", Start: ast.Position{ Column: 15, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 49, }, File: "year_time_test.flux", Source: "(table\n \t |> range(start: 2018-01-01T00:00:00Z)\n \t\t|> map(fn: (r) => ({r with _value: date.year(t: r._time)})))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "year_time_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "year_time_test.flux", Source: "table\n \t |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "year_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 16, Line: 48, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "year_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 16, Line: 48, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 48, }, File: "year_time_test.flux", Source: "start", Start: ast.Position{ Column: 16, Line: 48, }, }, }, Name: "start", }, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "year_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 23, Line: 48, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 48, }, File: "year_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 10, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 48, }, File: "year_time_test.flux", Source: "range", Start: ast.Position{ Column: 10, Line: 48, }, }, }, Name: "range", }, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "year_time_test.flux", Source: "table\n \t |> range(start: 2018-01-01T00:00:00Z)\n \t\t|> map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "year_time_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 11, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "year_time_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 11, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 49, }, File: "year_time_test.flux", Source: "fn", Start: ast.Position{ Column: 11, Line: 49, }, }, }, Name: "fn", }, Value: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "year_time_test.flux", Source: "(r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 15, Line: 49, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 49, }, File: "year_time_test.flux", Source: "({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 22, Line: 49, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "year_time_test.flux", Source: "{r with _value: date.year(t: r._time)}", Start: ast.Position{ Column: 23, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "year_time_test.flux", Source: "_value: date.year(t: r._time)", Start: ast.Position{ Column: 31, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 49, }, File: "year_time_test.flux", Source: "_value", Start: ast.Position{ Column: 31, Line: 49, }, }, }, Name: "_value", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "year_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "year_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 49, }, File: "year_time_test.flux", Source: "t", Start: ast.Position{ Column: 49, Line: 49, }, }, }, Name: "t", }, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "year_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 49, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 52, Line: 49, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "year_time_test.flux", Source: "_time", Start: ast.Position{ Column: 54, Line: 49, }, }, }, Name: "_time", }, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "year_time_test.flux", Source: "date.year(t: r._time)", Start: ast.Position{ Column: 39, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "year_time_test.flux", Source: "date.year", Start: ast.Position{ Column: 39, Line: 49, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 49, }, File: "year_time_test.flux", Source: "date", Start: ast.Position{ Column: 39, Line: 49, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 49, }, File: "year_time_test.flux", Source: "year", Start: ast.Position{ Column: 44, Line: 49, }, }, }, Name: "year", }, }, }, }}, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 49, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 24, Line: 49, }, }, }, Name: "r", }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 16, Line: 49, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 16, Line: 49, }, }, }, Name: "r", }, Value: nil, }}, }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 49, }, File: "year_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 7, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 49, }, File: "year_time_test.flux", Source: "map", Start: ast.Position{ Column: 7, Line: 49, }, }, }, Name: "map", }, }, }, }, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "year_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 46, }, File: "year_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Name: "table", }, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 46, }, File: "year_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 46, }, }, }}, }}, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "year_time_test.flux", Source: "_time_year = () =>\n \t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 8, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 51, }, File: "year_time_test.flux", Source: "_time_year", Start: ast.Position{ Column: 8, Line: 51, }, }, }, Name: "_time_year", }, Init: &ast.FunctionExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "year_time_test.flux", Source: "() =>\n \t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 21, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "year_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 52, }, File: "year_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year}", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 52, }, File: "year_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 5, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 52, }, File: "year_time_test.flux", Source: "input", Start: ast.Position{ Column: 5, Line: 52, }, }, }, Name: "input", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "year_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 32, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "year_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 32, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 52, }, File: "year_time_test.flux", Source: "csv", Start: ast.Position{ Column: 32, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "year_time_test.flux", Source: "inData", Start: ast.Position{ Column: 37, Line: 52, }, }, }, Name: "inData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 52, }, File: "year_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "year_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 52, }, File: "year_time_test.flux", Source: "testing", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 52, }, File: "year_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 20, Line: 52, }, }, }, Name: "loadStorage", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 52, }, File: "year_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 46, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 52, }, File: "year_time_test.flux", Source: "want", Start: ast.Position{ Column: 46, Line: 52, }, }, }, Name: "want", }, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "year_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 68, Line: 52, }, }, }, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "year_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 68, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 52, }, File: "year_time_test.flux", Source: "csv", Start: ast.Position{ Column: 68, Line: 52, }, }, }, Name: "csv", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "year_time_test.flux", Source: "outData", Start: ast.Position{ Column: 73, Line: 52, }, }, }, Name: "outData", }, }}, With: nil, }}, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 52, }, File: "year_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 52, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "year_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 52, Line: 52, }, }, }, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 52, }, File: "year_time_test.flux", Source: "testing", Start: ast.Position{ Column: 52, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "year_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 60, Line: 52, }, }, }, Name: "loadMem", }, }, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "year_time_test.flux", Source: "fn: t_time_year", Start: ast.Position{ Column: 83, Line: 52, }, }, }, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 52, }, File: "year_time_test.flux", Source: "fn", Start: ast.Position{ Column: 83, Line: 52, }, }, }, Name: "fn", }, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 52, }, File: "year_time_test.flux", Source: "t_time_year", Start: ast.Position{ Column: 87, Line: 52, }, }, }, Name: "t_time_year", }, }}, With: nil, }, }, Params: []*ast.Property{}, }, }, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 52, }, File: "year_time_test.flux", Source: "test _time_year = () =>\n \t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 3, Line: 51, }, }, }, }}, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_time_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "year_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 4, }, File: "year_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_time_test.flux", Source: "package date_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }}, Package: "date_test", Path: "date", }}
View Source
var SpecialFns map[string]values.Function
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.