---
- name: vlan_compress single vlan
  debug:
    msg: "{{ [1] | vlan_compress }}"
  register: result

- assert:
    that:
      - "'1' in result.msg"

- name: vlan_compress list of vlans1
  debug:
    msg: "{{ [1,2,3,4,5] | vlan_compress }}"
  register: result

- assert:
    that:
      - "'1-5' in result.msg"

- name: vlan_compress list of vlans2
  debug:
    msg: "{{ [1,2,3,5] | vlan_compress }}"
  register: result

- assert:
    that:
      - "'1-3,5' in result.msg"

- name: vlan_compress list of vlans3
  debug:
    msg: "{{ [1,2,4,5,6] | vlan_compress }}"
  register: result

- assert:
    that:
      - "'1-2,4-6' in result.msg"
