<commit_before>test = require "noflo-test"

test.component("tween/Timeline").
  discuss("Start a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
  discuss("get a started output & value = 0").
    receive.data("started", true).
    receive.data("value", 0.0).


  next().
  discuss("Start a reverse timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 1.0).

  next().
  discuss("Start/Stop a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("stop", true).
    send.disconnect("stop").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("stopped", true).

  next().
  discuss("Start and pause a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("pause", true).
    send.disconnect("pause").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("paused", true).

  next().
  discuss("Start, pause and unpause a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("pause", true).
    send.disconnect("pause").
    send.data("unpause", true).
    send.disconnect("unpause").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("paused", true).
    receive.data("unpaused", true).

export module<commit_msg>test: Timeline: ensure no ticking happens when not running<commit_after>test = require "noflo-test"

test.component("tween/Timeline").
  discuss("Start a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
  discuss("get a started output & value = 0").
    receive.data("started", true).
    receive.data("value", 0.0).


  next().
  discuss("Start a reverse timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 1.0).

  next().
  discuss("Start/Stop a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("stop", true).
    send.disconnect("stop").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("stopped", true).

  next().
  discuss("Start and pause a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("pause", true).
    send.disconnect("pause").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("paused", true).

  next().
  discuss("Start, pause and unpause a timeline").
    send.data("start", true).
    send.disconnect("start").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("pause", true).
    send.disconnect("pause").
    send.data("unpause", true).
    send.disconnect("unpause").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("paused", true).
    receive.data("unpaused", true).

  next().
  discuss("Timeline doesn't tick while stopped").
    send.data("start", true).
    send.disconnect("start").
    send.data("duration", 1000).
    send.disconnect("duration").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("stop", true).
    send.disconnect("stop").
    send.data("tick", true).
    send.disconnect("tick").
    send.data("reverse", true).
    send.disconnect("reverse").
    send.data("start", true).
    send.disconnect("start").
    send.data("tick", true).
    send.disconnect("tick").
  discuss("get a started output & value = 1").
    receive.data("started", true).
    receive.data("value", 0.0).
    receive.data("stopped", true).
    receive.data("started", true).
    receive.data("value", 1.0).

export module
{'fraction_non_alphanumeric': 0.19808695652173913, 'fraction_numerical': 0.013739130434782608, 'mean_word_length': 3.2008765522279035, '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': '1836125', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1766, 'n_words': 369}