<commit_before>Feature: 'select' clause

  The *select* clause specifies what attributes will be retrieved from the models specified by the *from* clause. Multiple values can be given and they are delimited by a comma. The *select* clause can take any method to which the objects specified by *from* know how to respond. The clause can also be given a special identifier in order to return the underlying models themselves instead of their attributes. If no attributes are specified then the underlying model will be returned instead, just as if the special identifier had been used (it is simply an alternate syntax and may look nicer in some queries).

  Sample usage:
  ````
  cql_repo.query do
    select name, tags, description_text
    from features
  end
  ````

  This clause can be repeated multiple times. The arguments for successive clauses are simply added to the previous arguments.


  Background: Repository with models
    Given a repository to query
    And the following feature has been modeled in the repository:
      """
      Feature: A test feature

        Scenario: Test 1
          * some steps

        @special_tag
        Scenario: Test 2
          * some other steps

        Scenario Outline: Test 3
          * some steps
        Examples: First examples
          | param |
          | value |
        Examples: Second examples
          | param |
          | value |
      """


  Scenario: Using 'select' to specify which attributes of an object to return
    When the following query is executed:
      """
      select name
      from scenarios
      """
    Then the following values are returned:
      | name   |
      | Test 1 |
      | Test 2 |

  Scenario: Selection of multiple attributes
    When the following query is executed:
      """
      select name, source_line
      from scenarios
      """
    Then the following values are returned:
      | name   | source_line |
      | Test 1 | 3           |
      | Test 2 | 7           |

  Scenario: Selection of the same attribute multiple times

  Note: Duplicate attribute selection should be combined with an 'as' clause in order to ensure that later attribute selections do not override earlier selections of the same attribute.

    When the following query is executed:
      """
      select name, name
      as name1, name2
      from scenarios
      """
    Then the following values are returned:
      | name1  | name2  |
      | Test 1 | Test 1 |
      | Test 2 | Test 2 |

  Scenario: Selection of the underlying models

  Note: There is no difference between the two different special identifiers. They are merely aliases for each other.

    When the following query is executed:
      """
      select :self
      from scenarios
      """
    Then the models for the following items are returned:
      | Test 1 |
      | Test 2 |
    And equivalent results are returned for the following query:
      """
      select :model
      from scenarios
      """

  Scenario: Repetitive selection
    When the following query is executed:
      """
      select name
      select source_line
      from scenarios
      """<commit_msg>Rename a test<commit_after>Feature: 'select' clause

  The *select* clause specifies what attributes will be retrieved from the models specified by the *from* clause. Multiple values can be given and they are delimited by a comma. The *select* clause can take any method to which the objects specified by *from* know how to respond. The clause can also be given a special identifier in order to return the underlying models themselves instead of their attributes. If no attributes are specified then the underlying model will be returned instead, just as if the special identifier had been used (it is simply an alternate syntax and may look nicer in some queries).

  Sample usage:
  ````
  cql_repo.query do
    select name, tags, description_text
    from features
  end
  ````

  This clause can be repeated multiple times. The arguments for successive clauses are simply added to the previous arguments.


  Background: Repository with models
    Given a repository to query
    And the following feature has been modeled in the repository:
      """
      Feature: A test feature

        Scenario: Test 1
          * some steps

        @special_tag
        Scenario: Test 2
          * some other steps

        Scenario Outline: Test 3
          * some steps
        Examples: First examples
          | param |
          | value |
        Examples: Second examples
          | param |
          | value |
      """


  Scenario: Using 'select' to specify which attributes of an object to return
    When the following query is executed:
      """
      select name
      from scenarios
      """
    Then the following values are returned:
      | name   |
      | Test 1 |
      | Test 2 |

  Scenario: Selection of multiple attributes
    When the following query is executed:
      """
      select name, source_line
      from scenarios
      """
    Then the following values are returned:
      | name   | source_line |
      | Test 1 | 3           |
      | Test 2 | 7           |

  Scenario: Selection of the same attribute multiple times

  Note: Duplicate attribute selection should be combined with an 'as' clause in order to ensure that later attribute selections do not override earlier selections of the same attribute.

    When the following query is executed:
      """
      select name, name
      as name1, name2
      from scenarios
      """
    Then the following values are returned:
      | name1  | name2  |
      | Test 1 | Test 1 |
      | Test 2 | Test 2 |

  Scenario: Selection of the underlying models

  Note: There is no difference between the two different special identifiers. They are merely aliases for each other.

    When the following query is executed:
      """
      select :self
      from scenarios
      """
    Then the models for the following items are returned:
      | Test 1 |
      | Test 2 |
    And equivalent results are returned for the following query:
      """
      select :model
      from scenarios
      """

  Scenario: Using the 'select' clause multiple times
    When the following query is executed:
      """
      select name
      select source_line
      from scenarios
      """
{'fraction_non_alphanumeric': 0.04946100190234623, 'fraction_numerical': 0.006024096385542169, 'mean_word_length': 2.329287598944591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7317378', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1444, 'n_words': 788}