comment about checking lengths

This commit is contained in:
Brandon Thomas committed 2026-03-22 04:04:02 -04:00
1 parent 04c394e8fc
commit 4573ff7183
48 files changed
+48 -48

No files matched your search

@@ -119,7 +119,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in AuditLogEntityAction::iter() {
let serialized = variant.to_str();
@@ -101,7 +101,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in AuditLogEntityType::iter() {
let serialized = variant.to_str();
@@ -76,7 +76,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in BatchGenerationEntityType::iter() {
let serialized = variant.to_str();
@@ -76,7 +76,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in BetaKeyProduct::iter() {
let serialized = variant.to_str();
@@ -128,7 +128,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in CommentEntityType::iter() {
let serialized = variant.to_str();
@@ -84,7 +84,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in EmailCategory::iter() {
let serialized = variant.to_str();
@@ -90,7 +90,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in StatsEntityType::iter() {
let serialized = variant.to_str();
@@ -147,7 +147,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in GenericDownloadType::iter() {
let serialized = variant.to_str();
@@ -216,7 +216,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in FrontendFailureCategory::iter() {
let serialized = variant.to_str();
@@ -74,7 +74,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in InferenceInputSourceTokenType::iter() {
let serialized = variant.to_str();
@@ -222,7 +222,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
use strum::IntoEnumIterator;
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
for variant in InferenceJobType::iter() {
let serialized = variant.to_str();
assert!(!serialized.is_empty(), "variant {:?} is too short", variant);
@@ -106,7 +106,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in InferenceResultType::iter() {
let serialized = variant.to_str();
@@ -202,7 +202,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in IdCategory::iter() {
let serialized = variant.to_str();
@@ -199,7 +199,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
use strum::IntoEnumIterator;
const MAX_LENGTH: usize = 24;
const MAX_LENGTH: usize = 24; // TODO(bt): Confirm database column width, then remove this comment.
for variant in MediaFileOriginModelType::iter() {
let serialized = variant.to_str();
assert!(!serialized.is_empty(), "variant {:?} is too short", variant);
@@ -86,7 +86,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in MediaUploadSource::iter() {
let serialized = variant.to_str();
@@ -92,7 +92,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in MediaUploadType::iter() {
let serialized = variant.to_str();
@@ -74,7 +74,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ModelType::iter() {
let serialized = variant.to_str();
@@ -80,7 +80,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in WeightsCategory::iter() {
let serialized = variant.to_str();
@@ -64,7 +64,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in WeightsFileType::iter() {
let serialized = variant.to_str();
@@ -120,7 +120,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
use strum::IntoEnumIterator;
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
for variant in WeightsType::iter() {
let serialized = variant.to_str();
assert!(!serialized.is_empty(), "variant {:?} is too short", variant);
@@ -71,7 +71,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ModelType::iter() {
let serialized = variant.to_str();
@@ -96,7 +96,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in WindowName::iter() {
let serialized = variant.to_str();
@@ -76,7 +76,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TtsModelType::iter() {
let serialized = variant.to_str();
@@ -113,7 +113,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TtsRenderStatus::iter() {
let serialized = variant.to_str();
@@ -146,7 +146,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in UserBookmarkEntityType::iter() {
let serialized = variant.to_str();
@@ -119,7 +119,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in UserRatingEntityType::iter() {
let serialized = variant.to_str();
@@ -170,7 +170,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in UserRatingValue::iter() {
let serialized = variant.to_str();
@@ -85,7 +85,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in VoiceConversionModelType::iter() {
let serialized = variant.to_str();
@@ -68,7 +68,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in VoiceConversionMediaTokenType::iter() {
let serialized = variant.to_str();
@@ -104,7 +104,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in RenditionStatus::iter() {
let serialized = variant.to_str();
@@ -104,7 +104,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ScrapingStatus::iter() {
let serialized = variant.to_str();
@@ -79,7 +79,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ZsVoiceEncodingType::iter() {
let serialized = variant.to_str();
@@ -79,7 +79,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ZsVoiceModelCategory::iter() {
let serialized = variant.to_str();
@@ -85,7 +85,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ZsVoiceModelType::iter() {
let serialized = variant.to_str();
@@ -122,7 +122,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
use strum::IntoEnumIterator;
const MAX_LENGTH: usize = 16;
const MAX_LENGTH: usize = 16; // TODO(bt): Confirm database column width, then remove this comment.
for variant in GenerationProvider::iter() {
let serialized = variant.to_str();
assert!(!serialized.is_empty(), "variant {:?} is too short", variant);
@@ -113,7 +113,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in JobStatus::iter() {
let serialized = variant.to_str();
@@ -133,7 +133,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in JobStatusPlus::iter() {
let serialized = variant.to_str();
@@ -123,7 +123,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in AwaitableJobStatus::iter() {
let serialized = variant.to_str();
@@ -106,7 +106,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ChatbotJobStatus::iter() {
let serialized = variant.to_str();
@@ -115,7 +115,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in SkipReason::iter() {
let serialized = variant.to_str();
@@ -148,7 +148,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in WebContentType::iter() {
let serialized = variant.to_str();
@@ -161,7 +161,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in ViewAs::iter() {
let serialized = variant.to_str();
@@ -201,7 +201,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in Visibility::iter() {
let serialized = variant.to_str();
@@ -82,7 +82,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in VocoderType::iter() {
let serialized = variant.to_str();
@@ -155,7 +155,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TaskFailureType::iter() {
let serialized = variant.to_str();
@@ -108,7 +108,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TaskMediaFileClass::iter() {
let serialized = variant.to_str();
@@ -142,7 +142,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TaskStatus::iter() {
let serialized = variant.to_str();
@@ -113,7 +113,7 @@ mod tests {
#[test]
fn serialized_length_ok_for_database() {
const MAX_LENGTH: usize = 32;
const MAX_LENGTH: usize = 32; // TODO(bt): Confirm database column width, then remove this comment.
use strum::IntoEnumIterator;
for variant in TaskType::iter() {
let serialized = variant.to_str();