# Path: pfg/util.py
# def subscript(n):
# def split_bits(s, n):
# def split_bytes(s):
# def native_to_memory_be(native):
# def native_to_memory_le(native):
# def split_bytes_le(components, n):
# def split_bytes_be(components, n):
# def component_bits(component, msb, lsb):
# def parse_components_with_mixed_sizes(component_str):
# def parse_components_with_separate_sizes(component_str, group_16=False):
# def expand_components(components, sizes, default_size=8):
# def pixel_bits(bits, i):
# def native_to_memory_byte_le(bits):
# def native_to_memory_byte_be(bits):
# def read_documentation(docfile):
# def round_up_to_multiple(n, m):


import unittest
import pfg
from pfg import util
        self.assertEqual(memory_le, fd.memory_le)
        self.assertEqual(memory_be, fd.memory_be)

    def assertFormatMatchesUnorm(self, format_str, native, memory_le, memory_be):
        self.assertFormatMatches(format_str, "UNORM", native, memory_le, memory_be)

    def assertFormatIsUnknown(self, format_str):
        self.assertIsNone(pfg.describe(format_str))

    def assertFindCompatibleMatches(self, format_str, family_str,
                                    everywhere, little_endian, big_endian,
                                    treat_x_as_a=False,
                                    treat_srgb_as_unorm=False,
                                    ignore_data_types=False):
        compatibility = pfg.find_compatible(
            format_str, family_str,
            treat_x_as_a=treat_x_as_a,
            treat_srgb_as_unorm=treat_srgb_as_unorm,
            ignore_data_types=ignore_data_types)
        # assertCountEqual checks for the existence of items regardless
        # of order (and has a misleading name...)
        self.assertCountEqual(everywhere, compatibility.everywhere)
        self.assertCountEqual(little_endian, compatibility.little_endian)
        self.assertCountEqual(big_endian, compatibility.big_endian)

    def assertHasDocumentationFor(self, family):
        documentation = pfg.document(family)
        self.assertEqual(util.read_documentation(family + ".md"), documentation)

def R(m,l): return util.component_bits("R", m, l)

# Path: pfg/util.py
# def subscript(n):
# def split_bits(s, n):
# def split_bytes(s):
# def native_to_memory_be(native):
# def native_to_memory_le(native):
# def split_bytes_le(components, n):
# def split_bytes_be(components, n):
# def component_bits(component, msb, lsb):
# def parse_components_with_mixed_sizes(component_str):
# def parse_components_with_separate_sizes(component_str, group_16=False):
# def expand_components(components, sizes, default_size=8):
# def pixel_bits(bits, i):
# def native_to_memory_byte_le(bits):
# def native_to_memory_byte_be(bits):
# def read_documentation(docfile):
# def round_up_to_multiple(n, m):


# Path: tests/pfgtest.py
import unittest
import pfg
from pfg import util

        self.assertEqual(memory_le, fd.memory_le)
        self.assertEqual(memory_be, fd.memory_be)

    def assertFormatMatchesUnorm(self, format_str, native, memory_le, memory_be):
        self.assertFormatMatches(format_str, "UNORM", native, memory_le, memory_be)

    def assertFormatIsUnknown(self, format_str):
        self.assertIsNone(pfg.describe(format_str))

    def assertFindCompatibleMatches(self, format_str, family_str,
                                    everywhere, little_endian, big_endian,
                                    treat_x_as_a=False,
                                    treat_srgb_as_unorm=False,
                                    ignore_data_types=False):
        compatibility = pfg.find_compatible(
            format_str, family_str,
            treat_x_as_a=treat_x_as_a,
            treat_srgb_as_unorm=treat_srgb_as_unorm,
            ignore_data_types=ignore_data_types)
        # assertCountEqual checks for the existence of items regardless
        # of order (and has a misleading name...)
        self.assertCountEqual(everywhere, compatibility.everywhere)
        self.assertCountEqual(little_endian, compatibility.little_endian)
        self.assertCountEqual(big_endian, compatibility.big_endian)

    def assertHasDocumentationFor(self, family):
        documentation = pfg.document(family)
        self.assertEqual(util.read_documentation(family + ".md"), documentation)

def R(m,l): return util.component_bits("R", m, l)

def G(m,l): return util.component_bits("G", m, l)