Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add interval to karate.range() and allow reverse ordering #1478

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

edwardsph
Copy link
Contributor

Description

Extends the new karate.range() method to support an optional 3rd argument for the interval. Also allows start and end to be reversed.

  * match list1 == [5, 6, 7, 8, 9, 10]",
  * def list2 = karate.range(5, 10, 2)",
  * match list2 == [5, 7, 9]",
  * def list3 = karate.range(10, 5, 2)",
  * match list3 == [10, 8, 6]"

Docs updated and tests also confirm that an interval of <= 0 will fail to avoid infinite loops.

  • Relevant Issues : none
  • Type of change :
    • New feature
    • Bug fix for existing feature
    • Code quality improvement
    • Addition or Improvement of tests
    • Addition or Improvement of documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants