# Path: moonlight/util/run_length.py
# def vertical_run_length_encoding(image):


import tensorflow as tf
from moonlight.util import run_length

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




class RunLengthTest(tf.test.TestCase):

  def testEmpty(self):
    with self.test_session() as sess:
      columns, values, lengths = sess.run(
          run_length.vertical_run_length_encoding(tf.zeros((0, 0), tf.bool)))
    self.assertAllEqual(columns, [])
    self.assertAllEqual(values, [])
    self.assertAllEqual(lengths, [])

  def testBooleanImage(self):
    img = tf.cast(
        [
            [0, 0, 1, 0, 0, 1],
            # pyformat: disable
            [1, 1, 1, 1, 1, 1],
            [0, 0, 1, 1, 1, 1],
            [0, 1, 1, 0, 1, 0]
        ],
        tf.bool)
    with self.test_session() as sess:
      columns, values, lengths = sess.run(

# Path: moonlight/util/run_length.py
# def vertical_run_length_encoding(image):


# Path: moonlight/util/run_length_test.py
import tensorflow as tf
from moonlight.util import run_length


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




class RunLengthTest(tf.test.TestCase):

  def testEmpty(self):
    with self.test_session() as sess:
      columns, values, lengths = sess.run(
          run_length.vertical_run_length_encoding(tf.zeros((0, 0), tf.bool)))
    self.assertAllEqual(columns, [])
    self.assertAllEqual(values, [])
    self.assertAllEqual(lengths, [])

  def testBooleanImage(self):
    img = tf.cast(
        [
            [0, 0, 1, 0, 0, 1],
            # pyformat: disable
            [1, 1, 1, 1, 1, 1],
            [0, 0, 1, 1, 1, 1],
            [0, 1, 1, 0, 1, 0]
        ],
        tf.bool)
    with self.test_session() as sess:
      columns, values, lengths = sess.run(

          run_length.vertical_run_length_encoding(img))