diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-26 01:55:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 01:55:03 +0900 |
| commit | cbb5118318706dc023eb8551b1f2628f395a6228 (patch) | |
| tree | 35c86c3191c2bfdb154fdfae7ad6f3292c0261f8 /crates/shirabe/tests/command/licenses_command_test.rs | |
| parent | 939359f13acfe8dbf4f16dac517fcbd67d46f611 (diff) | |
| download | php-shirabe-cbb5118318706dc023eb8551b1f2628f395a6228.tar.gz php-shirabe-cbb5118318706dc023eb8551b1f2628f395a6228.tar.zst php-shirabe-cbb5118318706dc023eb8551b1f2628f395a6228.zip | |
refactor(symfony-table): model rows/cells with enums instead of PhpMixed
The Table helper modeled a row's cells as PhpMixed and recovered the concrete
TableCell/TableSeparator types via runtime instance_of, leaving the entire
mixed/array bridge (to_row_vec, cell_colspan, row_get, ...) as todo!(). Replace
that with proper Row/Cell enums:
Row = HeaderDivider | Separator(TableSeparator) | Cells(Vec<Cell>)
Cell = Null | Value(String) | Cell(TableCell) | Separator(TableSeparator)
The internal header/body boundary that PHP detects by object identity
($divider === $row) becomes the dedicated Row::HeaderDivider variant. Style
arguments (PHP string|TableStyle) become a StyleName enum, so Table::new no
longer panics in resolve_style's instance_of stub; TableStyle derives Clone so
named styles resolve from the registry.
PhpMixed-based callers (SymfonyStyle::table, render_table, auditor's sanitize)
bridge via From<PhpMixed> for Cell/Row at the boundary.
Un-ignores LicensesCommandTest text-format cases (4) and
BaseDependencyCommandTest::why; output matches PHP exactly. Removes ~15 impl
todo!()s in the Table helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/command/licenses_command_test.rs')
| -rw-r--r-- | crates/shirabe/tests/command/licenses_command_test.rs | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/crates/shirabe/tests/command/licenses_command_test.rs b/crates/shirabe/tests/command/licenses_command_test.rs index 80708f6..9e6fc46 100644 --- a/crates/shirabe/tests/command/licenses_command_test.rs +++ b/crates/shirabe/tests/command/licenses_command_test.rs @@ -79,9 +79,6 @@ fn assert_lines(display: &str, expected: &[Vec<&str>]) { #[test] #[serial] -#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \ - (var.rs:191 todo!()); PhpMixed::Object carries no runtime class tag, so the Symfony \ - Table helper cannot distinguish TableSeparator/TableCell rows yet"] fn test_basic_run() { let _tear_down = set_up(); @@ -111,8 +108,6 @@ fn test_basic_run() { #[test] #[serial] -#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \ - (var.rs:191 todo!()); see test_basic_run"] fn test_no_dev() { let _tear_down = set_up(); @@ -246,8 +241,6 @@ fn test_format_unknown() { #[test] #[serial] -#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \ - (var.rs:191 todo!()); see test_basic_run"] fn test_locked() { let _tear_down = set_up(); @@ -280,8 +273,6 @@ fn test_locked() { #[test] #[serial] -#[ignore = "renders the text-format Table, which reaches shirabe_php_shim::instance_of \ - (var.rs:191 todo!()); see test_basic_run"] fn test_locked_no_dev() { let _tear_down = set_up(); |
