Small fix

This commit is contained in:
Trevi Awater
2024-03-04 09:29:04 +01:00
parent 55d6d6060e
commit b92331d904
6 changed files with 31 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.

View File

@@ -39,7 +39,7 @@ namespace Xamarin.Neo4j.Tests
} }
[Test] [Test]
public void TestWithReturnAll() public void TestWithLabeledAndAliasedReturnAll()
{ {
const string query = "MATCH (t:Tender)-[:LAST]->(z) RETURN *"; const string query = "MATCH (t:Tender)-[:LAST]->(z) RETURN *";
const string expected = "MATCH (t:Tender)-[display_variable_1:LAST]->(z) RETURN *"; const string expected = "MATCH (t:Tender)-[display_variable_1:LAST]->(z) RETURN *";
@@ -49,6 +49,28 @@ namespace Xamarin.Neo4j.Tests
Assert.AreEqual(expected, actual); Assert.AreEqual(expected, actual);
} }
[Test]
public void TestWithUnlabeledReturnAll()
{
const string query = "MATCH (t:Tender)-[]->(z) RETURN *";
const string expected = "MATCH (t:Tender)-[display_variable_1]->(z) RETURN *";
var actual = QueryHelper.ToDisplayQuery(query);
Assert.AreEqual(expected, actual);
}
[Test]
public void TestWithLabeledAndAliasedReturnAllWithMultipleRelationships()
{
const string query = "MATCH (t:Tender)-[:LAST]->(z)-[:NEXT]->(x) RETURN *";
const string expected = "MATCH (t:Tender)-[display_variable_1:LAST]->(z)-[display_variable_2:NEXT]->(x) RETURN *";
var actual = QueryHelper.ToDisplayQuery(query);
Assert.AreEqual(expected, actual);
}
[Test] [Test]
public void TestWithNoReturn() public void TestWithNoReturn()
{ {
@@ -95,5 +117,7 @@ namespace Xamarin.Neo4j.Tests
Assert.AreEqual(expected, actual); Assert.AreEqual(expected, actual);
} }
} }
} }

View File

@@ -99,6 +99,8 @@ namespace Xamarin.Neo4j.iOS.CustomRenderers
toolbar.Items = keyButtons; toolbar.Items = keyButtons;
Control.InputAccessoryView = toolbar; Control.InputAccessoryView = toolbar;
HighlightWords(_keyWords);
} }
} }

View File

@@ -27,7 +27,7 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>nl.resoftware.pocketgraph</string> <string>nl.resoftware.pocketgraph</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4</string> <string>5</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.1.0</string> <string>1.1.0</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>

View File

@@ -60,7 +60,7 @@ namespace Xamarin.Neo4j.Utilities
var returnIndex = transformedQuery.LastIndexOf("RETURN ", StringComparison.OrdinalIgnoreCase); var returnIndex = transformedQuery.LastIndexOf("RETURN ", StringComparison.OrdinalIgnoreCase);
var returnClause = transformedQuery.Substring(returnIndex + "RETURN ".Length); var returnClause = transformedQuery.Substring(returnIndex + "RETURN ".Length);
if (returnClause.Trim() != "*") if (!returnClause.Trim().StartsWith("*"))
{ {
var newReturnClause = returnClause; var newReturnClause = returnClause;
foreach (var rel in relationships) foreach (var rel in relationships)