kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/verifier/souffle_interpreter_test.cc (about)

     1  /*
     2   * Copyright 2020 The Kythe Authors. All rights reserved.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  #include "kythe/cxx/verifier/souffle_interpreter.h"
    18  
    19  #include <cstddef>
    20  #include <optional>
    21  #include <string_view>
    22  
    23  #include "absl/log/log.h"
    24  #include "gtest/gtest.h"
    25  
    26  namespace kythe::verifier {
    27  TEST(SouffleInterpreterTest, SmokeTest) {
    28    SymbolTable symbols;
    29    // Intern the symbols required by the prelude.
    30    symbols.intern("");
    31    symbols.intern("/kythe/node/kind");
    32    symbols.intern("anchor");
    33    symbols.intern("/kythe/loc/start");
    34    symbols.intern("/kythe/loc/end");
    35    Database db;
    36    AnchorMap anchors;
    37    std::vector<GoalGroup> groups;
    38    std::vector<Inspection> inspections;
    39    auto result = RunSouffle(
    40        symbols, groups, db, anchors, inspections,
    41        [](const Inspection&, std::optional<std::string_view>) { return true; },
    42        [](size_t) { return std::string(""); });
    43    ASSERT_TRUE(result.success);
    44  }
    45  }  // namespace kythe::verifier