# Path: Pyblio/Utils.py
# def compress_page_range (pages, separator='-'):
# def format (string, width, first, next):
# def generate_key (entry, table):
#     def __init__ (self):
#     def write (self, text):
# class StringStream:


import unittest
import sys
from Pyblio import Utils
# unit test for Utils


sys.path.append ('..')



class compress_page_range_test (unittest.TestCase):
    data = [("1-9", '1', '9'),
            ("200-201", '200', '1'),
            ("300-500", '300', '500'),
            ("3000-3049", '3000', '49'),
        ]

    def test01 (self):
        for i in self.data:
            p, r = i[0], i[1:]

# Path: Pyblio/Utils.py
# def compress_page_range (pages, separator='-'):
# def format (string, width, first, next):
# def generate_key (entry, table):
#     def __init__ (self):
#     def write (self, text):
# class StringStream:


# Path: Pyblio/test_Utils.py
import unittest
import sys
from Pyblio import Utils

# unit test for Utils


sys.path.append ('..')



class compress_page_range_test (unittest.TestCase):
    data = [("1-9", '1', '9'),
            ("200-201", '200', '1'),
            ("300-500", '300', '500'),
            ("3000-3049", '3000', '49'),
        ]

    def test01 (self):
        for i in self.data:
            p, r = i[0], i[1:]

            self.assertEqual (Utils.compress_page_range(p,False), r)