added tests for sequence with a count of 1

now checks for stride being 0 so it does not skip counts of 1 but still skips counts of 0
fixes #11422
This commit is contained in:
Brian Coca 2015-07-03 13:25:14 -04:00
parent 676c686994
commit e2c4cc70d6
3 changed files with 8 additions and 3 deletions

@ -1 +1 @@
Subproject commit 30377b7103553a6cf0f6fbd4f8cdf119dc0212a2
Subproject commit ea913bada2e4307c254c3277cd4b15304cacb9bb

View file

@ -203,8 +203,7 @@ class LookupModule(object):
)
self.sanity_check()
if self.start != self.end:
if self.stride != 0:
results.extend(self.generate_sequence())
except AnsibleError:
raise

View file

@ -81,10 +81,16 @@
with_sequence: count=0
register: count_of_zero
- name: test with_sequence count 1
set_fact: "{{ 'x' + item }}={{ item }}"
with_sequence: count=1
register: count_of_one
- assert:
that:
- count_of_zero | skipped
- not count_of_zero | failed
- not count_of_one | skipped
# WITH_RANDOM_CHOICE