package com.hubspot.jinjava.lib.tag;

import static org.assertj.core.api.Assertions.assertThat;

import com.hubspot.jinjava.BaseInterpretingTest;
import org.junit.Test;

public class CycleTagTest extends BaseInterpretingTest {

  @Test
  public void itDefaultsNullToImage() {
    String template = "{% for item in [0,1] %}{% cycle {{item}} %}{% endfor %}";
    assertThat(interpreter.render(template)).isEqualTo("{{item}}{{item}}");
  }
}

@@ -429,11 +429,737 @@
 %7D%22);%0A  %7D
+%0A%0A  @Test%0A  public void itDefaultsMultipleNullToImage() %7B%0A    String template = %22%7B%25 for item in %5B0,1%5D %25%7D%7B%25 cycle %7B%7Bfoo%7D%7D,%7B%7Bbar%7D%7D %25%7D%7B%25 endfor %25%7D%22;%0A    assertThat(interpreter.render(template)).isEqualTo(%22%7B%7Bfoo%7D%7D%7B%7Bbar%7D%7D%22);%0A  %7D%0A%0A  @Test%0A  public void itDefaultsNullToImageUsingAs() %7B%0A    String template =%0A      %22%7B%25 for item in %5B0,1%5D %25%7D%7B%25 cycle %7B%7Bitem%7D%7D as var %25%7D%7B%25 cycle var %25%7D%7B%25 endfor %25%7D%22;%0A    assertThat(interpreter.render(template)).isEqualTo(%22%7B%7Bitem%7D%7D%7B%7Bitem%7D%7D%22);%0A  %7D%0A%0A  @Test%0A  public void itDefaultsMultipleNullToImageUsingAs() %7B%0A    String template =%0A      %22%7B%25 for item in %5B0,1%5D %25%7D%7B%25 cycle %7B%7Bfoo%7D%7D,%7B%7Bbar%7D%7D as var %25%7D%7B%25 cycle var %25%7D%7B%25 endfor %25%7D%22;%0A    assertThat(interpreter.render(template)).isEqualTo(%22%7B%7Bfoo%7D%7D%7B%7Bbar%7D%7D%22);%0A  %7D
 %0A%7D%0A

Add more null handling cycle tag tests