()
| 289 | |
| 290 | #[test] |
| 291 | fn test_char_padding() { |
| 292 | let validator = StringConstraintValidator::new(); |
| 293 | let conn = setup_test_db(); |
| 294 | |
| 295 | // Add a CHAR constraint |
| 296 | conn.execute( |
| 297 | "INSERT INTO __pgsqlite_string_constraints (table_name, column_name, max_length, is_char_type) |
| 298 | VALUES ('test', 'code', 5, 1)", |
| 299 | [], |
| 300 | ).unwrap(); |
| 301 | |
| 302 | // Load constraints |
| 303 | validator.load_table_constraints(&conn, "test").unwrap(); |
| 304 | |
| 305 | // Test padding |
| 306 | assert_eq!(validator.pad_char_value("test", "code", "AB"), "AB "); |
| 307 | assert_eq!(validator.pad_char_value("test", "code", "12345"), "12345"); |
| 308 | assert_eq!(validator.pad_char_value("test", "code", ""), " "); |
| 309 | } |
| 310 | |
| 311 | #[test] |
| 312 | fn test_no_constraint() { |
nothing calls this directly
no test coverage detected