Implements test_{bin,bins} helper functions