All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.c.const-ish.sc Maven / Gradle / Ivy

There is a newer version: 4.0.78
Show newest version
//> using file assertions.sc

@main def main(inputPath: String) = {
  importCode(inputPath)
  val methods = cpg.method.internal.filter { method =>
    method.start.assignment.target
      .reachableBy(method.parameter.filter(_.code.contains("const")))
      .nonEmpty
  }.name

  val expected = Set(
    "modify_const_struct_member_cpp_cast",
    "modify_const_struct_member_c_cast",
    "modify_const_struct_cpp_cast",
    "modify_const_struct_c_cast"
  )
  assertContains("methods", methods, expected)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy