Add a simple test: computing a number in the Sylvester sequence

https://www.gnu.org/software/gawk/manual/html_node/Arbitrary-Precision-Integers.html#Arbitrary-Precision-Integers
This commit is contained in:
Pavel Cahyna 2018-03-12 15:25:48 +01:00
parent f422ddcf5e
commit 981068def2

46
tests/tests.yml Normal file
View File

@ -0,0 +1,46 @@
- hosts: all
vars:
- ansible_python_interpreter: /usr/bin/python3
- artifacts: ./artifacts
tags:
- classic
- container
- atomic
tasks:
- name: create artifacts
file:
path: "{{ artifacts }}"
state: directory
delegate_to: localhost
- name: do it all
block:
- name: calculate Silvester number
command: |
gawk -M 'BEGIN {
s = 2
for (i = 1; i <= 7; i++)
s = s * (s - 1) + 1
print s
}'
register: silvester
- name: verify Silvester number
fail:
when: silvester.stdout != '113423713055421844361000443'
always:
- name: write log
copy:
content: |
stderr:
{{ silvester.stderr }}
stdout:
{{ silvester.stdout }}
dest: "{{ artifacts }}/test.log"
delegate_to: localhost
# fetch:
# dest: "{{ artifacts }}/"
# src: "/tmp/test.log"
# flat: yes