• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15import {sqlColumnId} from '../../components/widgets/sql/table/sql_column';
16import {argTableColumn} from '../../components/widgets/sql/table/columns';
17
18test('arg_set_column.id', () => {
19  expect(sqlColumnId(argTableColumn('arg_set_id', 'arg1').column)).toBe(
20    'arg_set_id[arg1]',
21  );
22});
23
24test('arg_set_column.id_with_join', () => {
25  expect(
26    sqlColumnId(
27      argTableColumn(
28        {
29          column: 'arg_set_id',
30          source: {
31            table: 'foo',
32            joinOn: {
33              x: 'y',
34            },
35          },
36        },
37        'arg1',
38      ).column,
39    ),
40  ).toBe('foo[x=y].arg_set_id[arg1]');
41});
42