Skip to content

Commit

Permalink
Add tests for BothE and Coin.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed May 2, 2024
1 parent e2fcdb0 commit 439a2b5
Show file tree
Hide file tree
Showing 64 changed files with 3,829 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Core/Queries/GremlinQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ private Traversal Where(Traversal traversal, Expression left, ExpressionSemantic
effectivePredicate
.GetFilterStep(leftMemberExpressionKey));
}
case ParameterExpression parameterExpression:
case ParameterExpression:
{
if (rightValue is StepLabel)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
g.inject(42).coin(1)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
g.V().bothE('LivesIn','Speaks','WorksFor').project('id','label','properties').by(id).by(label).by(__.valueMap())
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
StepInstructions: [
{
OperatorName: inject,
Arguments: [
42
]
},
{
OperatorName: coin,
Arguments: [
1.0
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
StepInstructions: [
{
OperatorName: V
},
{
OperatorName: bothE,
Arguments: [
LivesIn,
Speaks,
WorksFor
]
},
{
OperatorName: project,
Arguments: [
id,
label,
properties
]
},
{
OperatorName: by,
Arguments: [
{
EnumName: T,
EnumValue: id
}
]
},
{
OperatorName: by,
Arguments: [
{
EnumName: T,
EnumValue: label
}
]
},
{
OperatorName: by,
Arguments: [
{
StepInstructions: [
{
OperatorName: valueMap
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
StepInstructions: [
{
OperatorName: inject,
Arguments: [
42
]
},
{
OperatorName: coin,
Arguments: [
1.0
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
StepInstructions: [
{
OperatorName: V
},
{
OperatorName: bothE,
Arguments: [
LivesIn,
Speaks,
WorksFor
]
},
{
OperatorName: project,
Arguments: [
id,
label,
properties
]
},
{
OperatorName: by,
Arguments: [
{
EnumName: T,
EnumValue: id
}
]
},
{
OperatorName: by,
Arguments: [
{
EnumName: T,
EnumValue: label
}
]
},
{
OperatorName: by,
Arguments: [
{
StepInstructions: [
{
OperatorName: valueMap
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "bytecode",
"processor": "traversal",
"args": {
"gremlin": {
"@type": "g:Bytecode",
"@value": {
"step": [
[
"inject",
{
"@type": "g:Int32",
"@value": 42
}
],
[
"coin",
{
"@type": "g:Double",
"@value": 1
}
]
]
}
},
"aliases": {
"g": "g"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "bytecode",
"processor": "traversal",
"args": {
"gremlin": {
"@type": "g:Bytecode",
"@value": {
"step": [
[
"V"
],
[
"bothE",
"LivesIn",
"Speaks",
"WorksFor"
],
[
"project",
"id",
"label",
"properties"
],
[
"by",
{
"@type": "g:T",
"@value": "id"
}
],
[
"by",
{
"@type": "g:T",
"@value": "label"
}
],
[
"by",
{
"@type": "g:Bytecode",
"@value": {
"step": [
[
"valueMap"
]
]
}
}
]
]
}
},
"aliases": {
"g": "g"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "bytecode",
"processor": "traversal",
"args": {
"gremlin": {
"@type": "g:Bytecode",
"@value": {
"step": [
[
"inject",
{
"@type": "g:Int32",
"@value": 42
}
],
[
"coin",
{
"@type": "g:Double",
"@value": 1
}
]
]
}
},
"aliases": {
"g": "g"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "bytecode",
"processor": "traversal",
"args": {
"gremlin": {
"@type": "g:Bytecode",
"@value": {
"step": [
[
"V"
],
[
"bothE",
"LivesIn",
"Speaks",
"WorksFor"
],
[
"project",
"id",
"label",
"properties"
],
[
"by",
{
"@type": "g:T",
"@value": "id"
}
],
[
"by",
{
"@type": "g:T",
"@value": "label"
}
],
[
"by",
{
"@type": "g:Bytecode",
"@value": {
"step": [
[
"valueMap"
]
]
}
}
]
]
}
},
"aliases": {
"g": "g"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "eval",
"processor": "",
"args": {
"gremlin": "g.inject(_a).coin(_b)",
"bindings": {
"_a": {
"@type": "g:Int32",
"@value": 42
},
"_b": {
"@type": "g:Double",
"@value": 1
}
},
"aliases": {
"g": "g"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"requestId": "00000000-0000-0000-0000-000000000000",
"op": "eval",
"processor": "",
"args": {
"gremlin": "g.V().bothE(_a,_b,_c).project(_d,_e,_f).by(id).by(label).by(__.valueMap())",
"bindings": {
"_a": "LivesIn",
"_b": "Speaks",
"_c": "WorksFor",
"_d": "id",
"_e": "label",
"_f": "properties"
},
"aliases": {
"g": "g"
}
}
}
Loading

0 comments on commit 439a2b5

Please sign in to comment.