Flutter Engine
 
Loading...
Searching...
No Matches
deps_parser_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6#include "gtest/gtest.h"
7
8TEST(DepsParserTest, Trivial) {
9 DepsParser parser;
10 ASSERT_TRUE(true);
11}
12
13TEST(DepsParserTest, ParseDepsWithWhitespace) {
14 DepsParser parser;
15 std::string input = R"(# Yadda yadda
16foo = {}
17deps = {
18 'engine/src/flutter/third_party/harfbuzz':
19 Var('flutter_git') + '/third_party/harfbuzz' + '@' + 'ea6a172f84f2cbcfed803b5ae71064c7afb6b5c2',
20 'engine/src/flutter/third_party/dart/tools/sdks/dart-sdk':
21 {'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'git_revision:4bb26ad346b166d759773e01ffc8247893b9681e'}]},
22 'third_party/doof':
23 {'packages': [{'package': 'doof', 'version': '1.0'}], 'dep_type': 'cipd'},
24}
25)";
26 std::vector<std::string> expected = {
27 "engine/src/flutter/third_party/dart/tools/sdks/dart-sdk",
28 "third_party/doof"};
29
30 std::vector<std::string> actual = parser.Parse(input);
31
32 ASSERT_EQ(actual.size(), expected.size());
33 EXPECT_EQ(actual[0], expected[0]);
34 EXPECT_EQ(actual[1], expected[1]);
35}
std::vector< std::string > Parse(std::string_view input)
static int input(yyscan_t yyscanner)
TEST(DepsParserTest, Trivial)