<commit_before>package ingraph.sandbox

import ingraph.compiler.CypherToQPlan
import ingraph.compiler.cypher2qplan.CypherParser
import ingraph.emf.util.PrettyPrinter
import org.scalatest.FunSuite
import org.slizaa.neo4j.opencypher.{openCypher => oc}

class TrainBenchmarkCypherTest extends FunSuite {

  test("Random test from cypher string") {
    TrainBenchmarkCypherTest.testQueryString(
      """MATCH (segment:Segment:Vertex)-[e2:Foo|Boo]-(v2:Bar)-[e3:Foo]-(v3:Bar), (a)-[ee]->(b)
        |WHERE segment.length < sin(0 + 2*0 % 6)
        |WITH *, segment, "foo" as foo
        |OPTIONAL MATCH (v)
        |WHERE foo = "foo"
        |RETURN DISTINCT segment, segment.length AS length, 2*5 as ten""".stripMargin)

  }
<commit_msg>Add tests for recurring edge variables<commit_after>package ingraph.sandbox

import ingraph.compiler.CypherToQPlan
import ingraph.compiler.cypher2qplan.CypherParser
import ingraph.emf.util.PrettyPrinter
import org.scalatest.FunSuite
import org.slizaa.neo4j.opencypher.{openCypher => oc}

class TrainBenchmarkCypherTest extends FunSuite {

  test("Random test from cypher string") {
    TrainBenchmarkCypherTest.testQueryString(
      """MATCH (segment:Segment:Vertex)-[e2:Foo|Boo]-(v2:Bar)-[e3:Foo]-(v3:Bar), (a)-[ee]->(b)
        |WHERE segment.length < sin(0 + 2*0 % 6)
        |WITH *, segment, "foo" as foo
        |OPTIONAL MATCH (v)
        |WHERE foo = "foo"
        |RETURN DISTINCT segment, segment.length AS length, 2*5 as ten""".stripMargin)

  }

  test("Random double edge variable in the same MATCH") {
    TrainBenchmarkCypherTest.testQueryString(
      """MATCH
        |  (a)-[e]->(b),
        |  (a)-[e]->(b)
        |RETURN a, e, b""".stripMargin)

  }

  test("Random double edge variable in separate MATCHes") {
    TrainBenchmarkCypherTest.testQueryString(
      """MATCH (a)-[e]->(b)
        |MATCH (a)-[e]->(b)
        |RETURN a, e, b""".stripMargin)

  }

{'fraction_non_alphanumeric': 0.1411395713538944, 'fraction_numerical': 0.012545739675901725, 'mean_word_length': 3.6009615384615383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3403977', 'n_tokens_mistral': 714, 'n_tokens_neox': 679, 'n_words': 139}