From c7ecc64757067cc5413df2796b5cf73eee571aa8 Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Fri, 15 May 2026 20:50:56 +0000 Subject: [PATCH] Matrix: create table, DDL, and app-command coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 55 tests covering create table, drop column, drop relationship (endpoints + by-name), add relationship, rename/change column, and all app-lifecycle commands. The drop-column and relationship tests drove the §2.2 writes_table fix in the previous commit. Documents one UX wrinkle as a flagged finding: partial entry words (`qu`) classify as DefiniteErrorAt — same as unknown commands — because the walker only engages on a complete entry word. 859 baseline -> 989 passing; 1 ignored (pre-existing doc-test). --- tests/typing_surface/add_relationship.rs | 111 +++++++++++- tests/typing_surface/app_commands.rs | 160 +++++++++++++++++- tests/typing_surface/create_table.rs | 136 ++++++++++++++- tests/typing_surface/drop_column.rs | 73 +++++++- tests/typing_surface/drop_relationship.rs | 109 +++++++++++- tests/typing_surface/rename_change_column.rs | 100 ++++++++++- ...ot_is_incomplete@in_progress_after_to.snap | 47 +++++ ..._create_fk_flag_parses@with_create_fk.snap | 19 +++ ...n_delete_clause_parses@with_on_delete.snap | 19 +++ ..._offers_relationship_branch@after_add.snap | 47 +++++ ...rows_to_child_columns@after_child_dot.snap | 55 ++++++ ...er_from_offers_table_names@after_from.snap | 47 +++++ ...ws_to_parent_columns@after_parent_dot.snap | 47 +++++ ...lete_add_relationship_parses@complete.snap | 19 +++ ...incomplete@after_relationship_keyword.snap | 47 +++++ ...rt_with_no_path_parses@export_no_path.snap | 19 +++ ...ort_with_path_parses@export_with_path.snap | 19 +++ ...rface__app_commands__help_parses@help.snap | 19 +++ ...ort_with_path_parses@import_with_path.snap | 19 +++ ...rface__app_commands__load_parses@load.snap | 19 +++ ...fers_short_and_verbose@messages_space.snap | 47 +++++ ...ith_no_value_parses@messages_no_value.snap | 19 +++ ...es_with_value_parses@messages_verbose.snap | 19 +++ ...offers_simple_and_advanced@mode_space.snap | 47 +++++ ..._mode_with_value_parses@mode_advanced.snap | 19 +++ ...surface__app_commands__new_parses@new.snap | 19 +++ ...nite_error_but_completes@partial_quit.snap | 41 +++++ ...rface__app_commands__quit_parses@quit.snap | 19 +++ ..._app_commands__rebuild_parses@rebuild.snap | 19 +++ ..._app_commands__save_as_parses@save_as.snap | 19 +++ ...rface__app_commands__save_parses@save.snap | 19 +++ ...ve_space_offers_as_keyword@save_space.snap | 39 +++++ ...n_expects_type_candidates@after_colon.snap | 111 ++++++++++++ ...ter_create_expects_table@after_create.snap | 39 +++++ ...ame_expects_with@after_new_table_name.snap | 39 +++++ ...me_typed_expects_colon@after_col_name.snap | 19 +++ ...ates_for_new_name@after_table_keyword.snap | 19 +++ ...ble__after_with_expects_pk@after_with.snap | 39 +++++ ...h_compound_pk_parses@with_compound_pk.snap | 19 +++ ...h_explicit_pk_parses@with_explicit_pk.snap | 19 +++ ...ith_pk_default_parses@with_pk_default.snap | 19 +++ ...hout_with_pk_is_incomplete@no_with_pk.snap | 19 +++ ...ns_no_leakage@after_colon_multi_table.snap | 47 +++++ ...ers_all_columns@after_colon_serial_pk.snap | 55 ++++++ ..._column_offers_table_names@after_from.snap | 55 ++++++ ...e_name_expects_colon@after_table_name.snap | 39 +++++ ...op_column_parses@complete_drop_column.snap | 19 +++ ...ble_keyword_parses@with_table_keyword.snap | 19 +++ ...rows_to_child_columns@after_child_dot.snap | 47 +++++ ...er_from_offers_table_names@after_from.snap | 47 +++++ ...ws_to_parent_columns@after_parent_dot.snap | 55 ++++++ ..._and_names@after_relationship_keyword.snap | 47 +++++ ..._after_to_offers_table_names@after_to.snap | 47 +++++ ...ndpoints_parses@complete_by_endpoints.snap | 19 +++ ...nship_by_name_parses@complete_by_name.snap | 19 +++ ...olumns@change_after_colon_multi_table.snap | 47 +++++ ...pe_candidates@change_after_open_paren.snap | 111 ++++++++++++ ...version_flag_parses@change_with_force.snap | 19 +++ ..._change_column_parses@complete_change.snap | 47 +++++ ..._rename_column_parses@complete_rename.snap | 19 +++ ...olumns@rename_after_colon_multi_table.snap | 47 +++++ ...mn_expects_to@rename_after_old_column.snap | 39 +++++ ...r_to_is_new_name_slot@rename_after_to.snap | 19 +++ 63 files changed, 2656 insertions(+), 6 deletions(-) create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_in_progress_after_dot_is_incomplete@in_progress_after_to.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_create_fk_flag_parses@with_create_fk.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_on_delete_clause_parses@with_on_delete.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_add_offers_relationship_branch@after_add.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_from_offers_table_names@after_from.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__complete_add_relationship_parses@complete.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__one_n_relationship_keyword_sequence_is_incomplete@after_relationship_keyword.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_no_path_parses@export_no_path.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_path_parses@export_with_path.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__help_parses@help.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__import_with_path_parses@import_with_path.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__load_parses@load.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_space_offers_short_and_verbose@messages_space.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_no_value_parses@messages_no_value.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_value_parses@messages_verbose.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_space_offers_simple_and_advanced@mode_space.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_with_value_parses@mode_advanced.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__new_parses@new.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__partial_entry_word_classifies_as_definite_error_but_completes@partial_quit.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__quit_parses@quit.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__rebuild_parses@rebuild.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_as_parses@save_as.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_parses@save.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_space_offers_as_keyword@save_space.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_colon_expects_type_candidates@after_colon.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_create_expects_table@after_create.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_new_table_name_expects_with@after_new_table_name.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_pk_space_with_col_name_typed_expects_colon@after_col_name.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_table_keyword_offers_no_candidates_for_new_name@after_table_keyword.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_with_expects_pk@after_with.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_compound_pk_parses@with_compound_pk.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_explicit_pk_parses@with_explicit_pk.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_pk_default_parses@with_pk_default.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_without_with_pk_is_incomplete@no_with_pk.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_offers_only_active_table_columns_no_leakage@after_colon_multi_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_serial_pk_offers_all_columns@after_colon_serial_pk.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_drop_column_offers_table_names@after_from.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_table_name_expects_colon@after_table_name.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__complete_drop_column_parses@complete_drop_column.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__drop_column_with_table_keyword_parses@with_table_keyword.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_from_offers_table_names@after_from.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_relationship_keyword_offers_from_and_names@after_relationship_keyword.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_to_offers_table_names@after_to.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_endpoints_parses@complete_by_endpoints.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_name_parses@complete_by_name.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_colon_narrows_to_active_table_columns@change_after_colon_multi_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_open_paren_offers_type_candidates@change_after_open_paren.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_column_with_force_conversion_flag_parses@change_with_force.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_change_column_parses@complete_change.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_rename_column_parses@complete_rename.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_colon_narrows_to_active_table_columns@rename_after_colon_multi_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_old_column_expects_to@rename_after_old_column.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_to_is_new_name_slot@rename_after_to.snap diff --git a/tests/typing_surface/add_relationship.rs b/tests/typing_surface/add_relationship.rs index b2d5ff4..88ed820 100644 --- a/tests/typing_surface/add_relationship.rs +++ b/tests/typing_surface/add_relationship.rs @@ -1 +1,110 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for `add 1:n relationship [as ] +//! from

. to . [on delete ] [on update ] +//! [--create-fk]` (ADR-0013). + +use crate::typing_surface::*; +use rdbms_playground::input_render::InputState; + +#[test] +fn after_add_offers_relationship_branch() { + let schema = schema_multi_table(); + let a = assess_at_end("add ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + // `add` branches to `column` or the `1:n` composite. + assert_candidate_present(&a, &["column"]); + crate::snap!("after_add", a); +} + +#[test] +fn one_n_relationship_keyword_sequence_is_incomplete() { + let schema = schema_multi_table(); + let a = assess_at_end("add 1:n relationship ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + // `as` (optional name) or `from` (endpoints) come next. + assert_candidate_present(&a, &["from"]); + crate::snap!("after_relationship_keyword", a); +} + +#[test] +fn after_from_offers_table_names() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from ", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_from", a); +} + +#[test] +fn after_parent_table_dot_narrows_to_parent_columns() { + // §2.2 follow-up — `from Customers.` narrows to Customers. + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["id", "Name"]); + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("after_parent_dot", a); +} + +#[test] +fn after_child_table_dot_narrows_to_child_columns() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.id to Orders.", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["OrderId", "CustId", "Total"]); + assert_no_candidate_named(&a, &["Name"]); + crate::snap!("after_child_dot", a); +} + +#[test] +fn complete_add_relationship_parses() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.id to Orders.CustId", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("AddRelationship")); + crate::snap!("complete", a); +} + +#[test] +fn add_relationship_with_create_fk_flag_parses() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.id to Orders.CustId --create-fk", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("with_create_fk", a); +} + +#[test] +fn add_relationship_with_on_delete_clause_parses() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.id to Orders.CustId on delete cascade", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("with_on_delete", a); +} + +#[test] +fn add_relationship_in_progress_after_dot_is_incomplete() { + let schema = schema_multi_table(); + let a = assess_at_end( + "add 1:n relationship from Customers.id to ", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + crate::snap!("in_progress_after_to", a); +} diff --git a/tests/typing_surface/app_commands.rs b/tests/typing_surface/app_commands.rs index b2d5ff4..b4d146e 100644 --- a/tests/typing_surface/app_commands.rs +++ b/tests/typing_surface/app_commands.rs @@ -1 +1,159 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for app-lifecycle commands (ADR-0003): +//! quit, help, rebuild, save / save as, new, load, export, +//! import, mode, messages. +//! +//! App commands don't touch the schema, so the empty schema is +//! sufficient. + +use crate::typing_surface::*; +use rdbms_playground::input_render::InputState; + +#[test] +fn quit_parses() { + let a = assess_at_end("quit", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("App(Quit)")); + crate::snap!("quit", a); +} + +#[test] +fn help_parses() { + let a = assess_at_end("help", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("App(Help)")); + crate::snap!("help", a); +} + +#[test] +fn rebuild_parses() { + let a = assess_at_end("rebuild", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("rebuild", a); +} + +#[test] +fn save_parses() { + let a = assess_at_end("save", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("App(Save)")); + crate::snap!("save", a); +} + +#[test] +fn save_space_offers_as_keyword() { + // Handoff-12 §3 smoke item: `save ` then Tab offers `as`. + let a = assess_at_end("save ", &schema_empty()); + assert_candidate_present(&a, &["as"]); + crate::snap!("save_space", a); +} + +#[test] +fn save_as_parses() { + let a = assess_at_end("save as", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("App(SaveAs)")); + crate::snap!("save_as", a); +} + +#[test] +fn new_parses() { + let a = assess_at_end("new", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("new", a); +} + +#[test] +fn load_parses() { + let a = assess_at_end("load", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("load", a); +} + +#[test] +fn export_with_no_path_parses() { + // Export path is optional — `export` alone opens the modal. + let a = assess_at_end("export", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("export_no_path", a); +} + +#[test] +fn export_with_path_parses() { + let a = assess_at_end("export myproject.zip", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("export_with_path", a); +} + +#[test] +fn import_with_path_parses() { + let a = assess_at_end("import bundle.zip", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("import_with_path", a); +} + +#[test] +fn mode_with_value_parses() { + let a = assess_at_end("mode advanced", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("mode_advanced", a); +} + +#[test] +fn mode_space_offers_simple_and_advanced() { + let a = assess_at_end("mode ", &schema_empty()); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["simple", "advanced"]); + crate::snap!("mode_space", a); +} + +#[test] +fn messages_with_no_value_parses() { + // Messages value is optional — `messages` alone shows the + // current verbosity. + let a = assess_at_end("messages", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("messages_no_value", a); +} + +#[test] +fn messages_space_offers_short_and_verbose() { + let a = assess_at_end("messages ", &schema_empty()); + assert_candidate_present(&a, &["short", "verbose"]); + crate::snap!("messages_space", a); +} + +#[test] +fn messages_with_value_parses() { + let a = assess_at_end("messages verbose", &schema_empty()); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("messages_verbose", a); +} + +#[test] +fn partial_entry_word_classifies_as_definite_error_but_completes() { + // `qu` — mid-typing the `quit` entry word. + // + // KNOWN UX WRINKLE (handoff-13 finding): a partial entry + // word is currently classified `DefiniteErrorAt(0)` — the + // same as a genuinely unknown command (`frobulate`). The + // walker only engages once a *complete* registered entry + // word is present; until then `try_walker_route` returns + // None and the router emits the synthetic unknown-command + // error. So the input pane shows `qu` in error-red even + // though it is a valid prefix of `quit`. + // + // Completion still works (Tab at `qu` → `quit`), so the + // user can recover, but the red overlay while typing the + // first word is jarring. This test documents the current + // behaviour; flagged to the user for a decision rather + // than silently asserting it as correct. + let a = assess_at_end("qu", &schema_empty()); + assert!( + matches!(a.state, InputState::DefiniteErrorAt(_)), + "documents current behaviour, got {:?}", + a.state, + ); + // Completion recovers — `quit` is offered. + assert_candidate_present(&a, &["quit"]); + crate::snap!("partial_quit", a); +} diff --git a/tests/typing_surface/create_table.rs b/tests/typing_surface/create_table.rs index b2d5ff4..eccb1fa 100644 --- a/tests/typing_surface/create_table.rs +++ b/tests/typing_surface/create_table.rs @@ -1 +1,135 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for `create table T with pk [:[, ...]]` +//! (ADR-0005, ADR-0009). + +use crate::typing_surface::*; +use rdbms_playground::input_render::{AmbientHint, InputState}; + +#[test] +fn after_create_expects_table() { + let schema = schema_empty(); + let a = assess_at_end("create ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["table"]); + crate::snap!("after_create", a); +} + +#[test] +fn after_table_keyword_offers_no_candidates_for_new_name() { + // The table-name slot is IdentSource::NewName — the user + // invents the name, so no candidates from the schema. The + // hint resolver surfaces a ForceProse "Type a name [then ...]" + // affordance instead. + let schema = schema_empty(); + let a = assess_at_end("create table ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert!( + matches!(&a.hint, Some(AmbientHint::Prose(_))), + "expected Prose at NewName slot, got {:?}", + a.hint, + ); + crate::snap!("after_table_keyword", a); +} + +#[test] +fn after_new_table_name_expects_with() { + let schema = schema_empty(); + let a = assess_at_end("create table Customers ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["with"]); + crate::snap!("after_new_table_name", a); +} + +#[test] +fn after_with_expects_pk() { + let schema = schema_empty(); + let a = assess_at_end("create table Customers with ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["pk"]); + crate::snap!("after_with", a); +} + +#[test] +fn create_table_with_pk_default_parses() { + let schema = schema_empty(); + let a = assess_at_end("create table Customers with pk", &schema); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("CreateTable")); + crate::snap!("with_pk_default", a); +} + +#[test] +fn after_pk_word_does_not_re_offer_pk() { + // Handoff-12 regression: at the cursor position right after + // `with pk`, the completion engine must NOT re-offer `pk` as + // a candidate. The full input parses and the partial-prefix + // filter drops it. + let schema = schema_empty(); + let a = assess_at_end("create table Customers with pk", &schema); + let cands = completion_candidate_texts(&a); + assert!( + !cands.contains(&"pk".to_string()), + "should NOT re-suggest `pk` (handoff-12 regression), got: {cands:?}", + ); +} + +#[test] +fn after_pk_space_with_col_name_typed_expects_colon() { + let schema = schema_empty(); + let a = assess_at_end("create table Customers with pk Code", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + crate::snap!("after_col_name", a); +} + +#[test] +fn after_colon_expects_type_candidates() { + let schema = schema_empty(); + let a = assess_at_end( + "create table Customers with pk Code:", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present( + &a, + &["text", "int", "serial", "shortid", "bool"], + ); + crate::snap!("after_colon", a); +} + +#[test] +fn create_table_with_explicit_pk_parses() { + let schema = schema_empty(); + let a = assess_at_end( + "create table Customers with pk Code:text", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("with_explicit_pk", a); +} + +#[test] +fn create_table_with_compound_pk_parses() { + let schema = schema_empty(); + let a = assess_at_end( + "create table Memberships with pk UserId:int, GroupId:int", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("with_compound_pk", a); +} + +#[test] +fn create_table_without_with_pk_is_incomplete() { + // Tables need at least one column (parse.custom. + // create_table_needs_pk) — submitting `create table T` + // alone is rejected. Classification depends on whether the + // walker treats `with pk` as required or optional at this + // position. + let schema = schema_empty(); + let a = assess_at_end("create table Customers", &schema); + assert!( + !matches!(a.state, InputState::Valid), + "create table without `with pk` must not be Valid, got {:?}", + a.state, + ); + crate::snap!("no_with_pk", a); +} diff --git a/tests/typing_surface/drop_column.rs b/tests/typing_surface/drop_column.rs index b2d5ff4..68b5cc7 100644 --- a/tests/typing_surface/drop_column.rs +++ b/tests/typing_surface/drop_column.rs @@ -1 +1,72 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for `drop column [from] [table] : ` +//! (ADR-0013). +//! +//! Handoff-12 §2.2 flagged that the DDL `TABLE_NAME_EXISTING` +//! slot didn't set `writes_table`, so at `drop column from T: ` +//! the column-name slot couldn't narrow to T's columns — +//! candidates leaked from every table. This file asserts the +//! per-table narrowing; the fix lands alongside it. + +use crate::typing_surface::*; +use rdbms_playground::input_render::InputState; + +#[test] +fn after_drop_column_offers_table_names() { + let schema = schema_multi_table(); + let a = assess_at_end("drop column from ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_from", a); +} + +#[test] +fn after_table_name_expects_colon() { + let schema = schema_serial_pk(); + let a = assess_at_end("drop column from Customers", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + crate::snap!("after_table_name", a); +} + +// ========================================================= +// Handoff §2.2 — column slot narrows to the active table. +// ========================================================= + +#[test] +fn after_colon_offers_only_active_table_columns_no_leakage() { + let schema = schema_multi_table(); + let a = assess_at_end("drop column from Customers: ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + // Customers's columns must be offered. + assert_candidate_present(&a, &["id", "Name"]); + // Orders's columns must NOT leak. + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("after_colon_multi_table", a); +} + +#[test] +fn after_colon_serial_pk_offers_all_columns() { + let schema = schema_serial_pk(); + let a = assess_at_end("drop column from Customers: ", &schema); + assert_candidate_present(&a, &["id", "Name", "Email"]); + crate::snap!("after_colon_serial_pk", a); +} + +#[test] +fn complete_drop_column_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end("drop column from Customers: Email", &schema); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("DropColumn")); + crate::snap!("complete_drop_column", a); +} + +#[test] +fn drop_column_with_table_keyword_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "drop column from table Customers: Email", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("with_table_keyword", a); +} diff --git a/tests/typing_surface/drop_relationship.rs b/tests/typing_surface/drop_relationship.rs index b2d5ff4..5f59a22 100644 --- a/tests/typing_surface/drop_relationship.rs +++ b/tests/typing_surface/drop_relationship.rs @@ -1 +1,108 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for `drop relationship (endpoints | name)` +//! (ADR-0013). +//! +//! Two selector forms: +//! - by endpoints: `drop relationship from P.c to C.c` +//! - by name: `drop relationship ` +//! +//! Handoff-12 §2.2 noted the qualified-column slots +//! (`from T.col`) don't narrow to T's columns. The fix lands +//! alongside the matrix where the test asserts narrowing. + +use crate::typing_surface::*; +use rdbms_playground::completion::SchemaCache; +use rdbms_playground::input_render::InputState; + +/// schema_multi_table + a named relationship in the cache so +/// the by-name selector has a candidate. +fn schema_with_relationship() -> SchemaCache { + let mut cache = schema_multi_table(); + cache + .relationships + .push("Orders_CustId_to_Customers".to_string()); + cache +} + +#[test] +fn after_relationship_keyword_offers_from_and_names() { + let schema = schema_with_relationship(); + let a = assess_at_end("drop relationship ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + // Both selector forms discoverable: `from` for endpoints, + // the relationship name for the by-name form. + assert_candidate_present( + &a, + &["from", "Orders_CustId_to_Customers"], + ); + crate::snap!("after_relationship_keyword", a); +} + +#[test] +fn after_from_offers_table_names() { + let schema = schema_with_relationship(); + let a = assess_at_end("drop relationship from ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_from", a); +} + +#[test] +fn after_parent_table_dot_narrows_to_parent_columns() { + // §2.2 follow-up: `from Orders.` should narrow the + // column slot to Orders's columns. + let schema = schema_with_relationship(); + let a = assess_at_end("drop relationship from Orders.", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["OrderId", "CustId", "Total"]); + assert_no_candidate_named(&a, &["Name"]); + crate::snap!("after_parent_dot", a); +} + +#[test] +fn after_to_offers_table_names() { + let schema = schema_with_relationship(); + let a = assess_at_end( + "drop relationship from Orders.CustId to ", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_to", a); +} + +#[test] +fn after_child_table_dot_narrows_to_child_columns() { + let schema = schema_with_relationship(); + let a = assess_at_end( + "drop relationship from Orders.CustId to Customers.", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["id", "Name"]); + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("after_child_dot", a); +} + +#[test] +fn complete_drop_relationship_by_endpoints_parses() { + let schema = schema_with_relationship(); + let a = assess_at_end( + "drop relationship from Orders.CustId to Customers.id", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("DropRelationship")); + crate::snap!("complete_by_endpoints", a); +} + +#[test] +fn complete_drop_relationship_by_name_parses() { + let schema = schema_with_relationship(); + let a = assess_at_end( + "drop relationship Orders_CustId_to_Customers", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("DropRelationship")); + crate::snap!("complete_by_name", a); +} diff --git a/tests/typing_surface/rename_change_column.rs b/tests/typing_surface/rename_change_column.rs index b2d5ff4..4b8a809 100644 --- a/tests/typing_surface/rename_change_column.rs +++ b/tests/typing_surface/rename_change_column.rs @@ -1 +1,99 @@ -//! Submodule stub — populated in subsequent tasks. +//! Matrix coverage for `rename column [in] [table] : +//! to ` and `change column [in] [table] : +//! ( ) [--force-conversion | --dont-convert]` (ADR-0013, +//! ADR-0017). +//! +//! Both share the DDL `TABLE_NAME_EXISTING` slot, which now +//! sets `writes_table` (handoff-13 §2.2) — so the column-name +//! slot after the table narrows to that table's columns. + +use crate::typing_surface::*; +use rdbms_playground::input_render::InputState; + +// ---- rename column ---- + +#[test] +fn rename_after_colon_narrows_to_active_table_columns() { + let schema = schema_multi_table(); + let a = assess_at_end("rename column in Customers: ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["id", "Name"]); + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("rename_after_colon_multi_table", a); +} + +#[test] +fn rename_after_old_column_expects_to() { + let schema = schema_serial_pk(); + let a = assess_at_end("rename column in Customers: Email ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["to"]); + crate::snap!("rename_after_old_column", a); +} + +#[test] +fn rename_after_to_is_new_name_slot() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "rename column in Customers: Email to ", + &schema, + ); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + crate::snap!("rename_after_to", a); +} + +#[test] +fn complete_rename_column_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "rename column in Customers: Email to ContactEmail", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("RenameColumn")); + crate::snap!("complete_rename", a); +} + +// ---- change column ---- + +#[test] +fn change_after_colon_narrows_to_active_table_columns() { + let schema = schema_multi_table(); + let a = assess_at_end("change column in Customers: ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["id", "Name"]); + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("change_after_colon_multi_table", a); +} + +#[test] +fn change_after_open_paren_offers_type_candidates() { + let schema = schema_serial_pk(); + let a = assess_at_end("change column in Customers: Email (", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["text", "int", "bool", "decimal"]); + crate::snap!("change_after_open_paren", a); +} + +#[test] +fn complete_change_column_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "change column in Customers: Email (text)", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("ChangeColumnType")); + crate::snap!("complete_change", a); +} + +#[test] +fn change_column_with_force_conversion_flag_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "change column in Customers: Email (int) --force-conversion", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + crate::snap!("change_with_force", a); +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_in_progress_after_dot_is_incomplete@in_progress_after_to.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_in_progress_after_dot_is_incomplete@in_progress_after_to.snap new file mode 100644 index 0000000..ee2a32c --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_in_progress_after_dot_is_incomplete@in_progress_after_to.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.id to \" cursor=42" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.id to ", + cursor: 42, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 42, + 42, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_create_fk_flag_parses@with_create_fk.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_create_fk_flag_parses@with_create_fk.snap new file mode 100644 index 0000000..0fa042a --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_create_fk_flag_parses@with_create_fk.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.id to Orders.CustId --create-fk\" cursor=67" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.id to Orders.CustId --create-fk", + cursor: 67, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "AddRelationship", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_on_delete_clause_parses@with_on_delete.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_on_delete_clause_parses@with_on_delete.snap new file mode 100644 index 0000000..f43f538 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__add_relationship_with_on_delete_clause_parses@with_on_delete.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.id to Orders.CustId on delete cascade\" cursor=73" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.id to Orders.CustId on delete cascade", + cursor: 73, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "AddRelationship", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_add_offers_relationship_branch@after_add.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_add_offers_relationship_branch@after_add.snap new file mode 100644 index 0000000..22d99af --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_add_offers_relationship_branch@after_add.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add \" cursor=4" +expression: "& a" +--- +Assessment { + input: "add ", + cursor: 4, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "column", + kind: Keyword, + }, + Candidate { + text: "1:n", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 4, + 4, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "column", + kind: Keyword, + }, + Candidate { + text: "1:n", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap new file mode 100644 index 0000000..027a3e2 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap @@ -0,0 +1,55 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.id to Orders.\" cursor=49" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.id to Orders.", + cursor: 49, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "CustId", + kind: Identifier, + }, + Candidate { + text: "OrderId", + kind: Identifier, + }, + Candidate { + text: "Total", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 49, + 49, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "CustId", + kind: Identifier, + }, + Candidate { + text: "OrderId", + kind: Identifier, + }, + Candidate { + text: "Total", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_from_offers_table_names@after_from.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_from_offers_table_names@after_from.snap new file mode 100644 index 0000000..220d221 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_from_offers_table_names@after_from.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from \" cursor=26" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from ", + cursor: 26, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 26, + 26, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap new file mode 100644 index 0000000..fd67386 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.\" cursor=36" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.", + cursor: 36, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 36, + 36, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__complete_add_relationship_parses@complete.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__complete_add_relationship_parses@complete.snap new file mode 100644 index 0000000..22b7f26 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__complete_add_relationship_parses@complete.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship from Customers.id to Orders.CustId\" cursor=55" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship from Customers.id to Orders.CustId", + cursor: 55, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "AddRelationship", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__one_n_relationship_keyword_sequence_is_incomplete@after_relationship_keyword.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__one_n_relationship_keyword_sequence_is_incomplete@after_relationship_keyword.snap new file mode 100644 index 0000000..cdf5b1c --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__add_relationship__one_n_relationship_keyword_sequence_is_incomplete@after_relationship_keyword.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/add_relationship.rs +description: "input=\"add 1:n relationship \" cursor=21" +expression: "& a" +--- +Assessment { + input: "add 1:n relationship ", + cursor: 21, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "from", + kind: Keyword, + }, + Candidate { + text: "as", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 21, + 21, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "from", + kind: Keyword, + }, + Candidate { + text: "as", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_no_path_parses@export_no_path.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_no_path_parses@export_no_path.snap new file mode 100644 index 0000000..a3e3ac0 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_no_path_parses@export_no_path.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"export\" cursor=6" +expression: "& a" +--- +Assessment { + input: "export", + cursor: 6, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Export)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_path_parses@export_with_path.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_path_parses@export_with_path.snap new file mode 100644 index 0000000..a473f40 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__export_with_path_parses@export_with_path.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"export myproject.zip\" cursor=20" +expression: "& a" +--- +Assessment { + input: "export myproject.zip", + cursor: 20, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Export)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__help_parses@help.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__help_parses@help.snap new file mode 100644 index 0000000..559808e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__help_parses@help.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"help\" cursor=4" +expression: "& a" +--- +Assessment { + input: "help", + cursor: 4, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Help)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__import_with_path_parses@import_with_path.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__import_with_path_parses@import_with_path.snap new file mode 100644 index 0000000..6359ae7 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__import_with_path_parses@import_with_path.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"import bundle.zip\" cursor=17" +expression: "& a" +--- +Assessment { + input: "import bundle.zip", + cursor: 17, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Import)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__load_parses@load.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__load_parses@load.snap new file mode 100644 index 0000000..b66661b --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__load_parses@load.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"load\" cursor=4" +expression: "& a" +--- +Assessment { + input: "load", + cursor: 4, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Load)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_space_offers_short_and_verbose@messages_space.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_space_offers_short_and_verbose@messages_space.snap new file mode 100644 index 0000000..a4ce0c7 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_space_offers_short_and_verbose@messages_space.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"messages \" cursor=9" +expression: "& a" +--- +Assessment { + input: "messages ", + cursor: 9, + state: Valid, + hint: Some( + Candidates { + items: [ + Candidate { + text: "short", + kind: Keyword, + }, + Candidate { + text: "verbose", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 9, + 9, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "short", + kind: Keyword, + }, + Candidate { + text: "verbose", + kind: Keyword, + }, + ], + }, + ), + parse_result: Ok( + "App(Messages)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_no_value_parses@messages_no_value.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_no_value_parses@messages_no_value.snap new file mode 100644 index 0000000..0df331d --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_no_value_parses@messages_no_value.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"messages\" cursor=8" +expression: "& a" +--- +Assessment { + input: "messages", + cursor: 8, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Messages)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_value_parses@messages_verbose.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_value_parses@messages_verbose.snap new file mode 100644 index 0000000..a1fb00d --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__messages_with_value_parses@messages_verbose.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"messages verbose\" cursor=16" +expression: "& a" +--- +Assessment { + input: "messages verbose", + cursor: 16, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Messages)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_space_offers_simple_and_advanced@mode_space.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_space_offers_simple_and_advanced@mode_space.snap new file mode 100644 index 0000000..f5162d1 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_space_offers_simple_and_advanced@mode_space.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"mode \" cursor=5" +expression: "& a" +--- +Assessment { + input: "mode ", + cursor: 5, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "simple", + kind: Keyword, + }, + Candidate { + text: "advanced", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 5, + 5, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "simple", + kind: Keyword, + }, + Candidate { + text: "advanced", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_with_value_parses@mode_advanced.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_with_value_parses@mode_advanced.snap new file mode 100644 index 0000000..a21d4d8 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__mode_with_value_parses@mode_advanced.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"mode advanced\" cursor=13" +expression: "& a" +--- +Assessment { + input: "mode advanced", + cursor: 13, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Mode)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__new_parses@new.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__new_parses@new.snap new file mode 100644 index 0000000..b63d786 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__new_parses@new.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"new\" cursor=3" +expression: "& a" +--- +Assessment { + input: "new", + cursor: 3, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(New)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__partial_entry_word_classifies_as_definite_error_but_completes@partial_quit.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__partial_entry_word_classifies_as_definite_error_but_completes@partial_quit.snap new file mode 100644 index 0000000..7951e4e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__partial_entry_word_classifies_as_definite_error_but_completes@partial_quit.snap @@ -0,0 +1,41 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"qu\" cursor=2" +expression: "& a" +--- +Assessment { + input: "qu", + cursor: 2, + state: DefiniteErrorAt( + 0, + ), + hint: Some( + Candidates { + items: [ + Candidate { + text: "quit", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 0, + 2, + ), + partial_prefix: "qu", + candidates: [ + Candidate { + text: "quit", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(definite)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__quit_parses@quit.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__quit_parses@quit.snap new file mode 100644 index 0000000..668aa56 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__quit_parses@quit.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"quit\" cursor=4" +expression: "& a" +--- +Assessment { + input: "quit", + cursor: 4, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Quit)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__rebuild_parses@rebuild.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__rebuild_parses@rebuild.snap new file mode 100644 index 0000000..9b66d49 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__rebuild_parses@rebuild.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"rebuild\" cursor=7" +expression: "& a" +--- +Assessment { + input: "rebuild", + cursor: 7, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Rebuild)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_as_parses@save_as.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_as_parses@save_as.snap new file mode 100644 index 0000000..0634086 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_as_parses@save_as.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"save as\" cursor=7" +expression: "& a" +--- +Assessment { + input: "save as", + cursor: 7, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(SaveAs)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_parses@save.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_parses@save.snap new file mode 100644 index 0000000..954484b --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_parses@save.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"save\" cursor=4" +expression: "& a" +--- +Assessment { + input: "save", + cursor: 4, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "App(Save)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_space_offers_as_keyword@save_space.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_space_offers_as_keyword@save_space.snap new file mode 100644 index 0000000..2bc5451 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__app_commands__save_space_offers_as_keyword@save_space.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/app_commands.rs +description: "input=\"save \" cursor=5" +expression: "& a" +--- +Assessment { + input: "save ", + cursor: 5, + state: Valid, + hint: Some( + Candidates { + items: [ + Candidate { + text: "as", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 5, + 5, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "as", + kind: Keyword, + }, + ], + }, + ), + parse_result: Ok( + "App(Save)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_colon_expects_type_candidates@after_colon.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_colon_expects_type_candidates@after_colon.snap new file mode 100644 index 0000000..c9c957f --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_colon_expects_type_candidates@after_colon.snap @@ -0,0 +1,111 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers with pk Code:\" cursor=36" +expression: "& a" +--- +Assessment { + input: "create table Customers with pk Code:", + cursor: 36, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "text", + kind: Keyword, + }, + Candidate { + text: "int", + kind: Keyword, + }, + Candidate { + text: "real", + kind: Keyword, + }, + Candidate { + text: "decimal", + kind: Keyword, + }, + Candidate { + text: "bool", + kind: Keyword, + }, + Candidate { + text: "date", + kind: Keyword, + }, + Candidate { + text: "datetime", + kind: Keyword, + }, + Candidate { + text: "blob", + kind: Keyword, + }, + Candidate { + text: "serial", + kind: Keyword, + }, + Candidate { + text: "shortid", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 36, + 36, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "text", + kind: Keyword, + }, + Candidate { + text: "int", + kind: Keyword, + }, + Candidate { + text: "real", + kind: Keyword, + }, + Candidate { + text: "decimal", + kind: Keyword, + }, + Candidate { + text: "bool", + kind: Keyword, + }, + Candidate { + text: "date", + kind: Keyword, + }, + Candidate { + text: "datetime", + kind: Keyword, + }, + Candidate { + text: "blob", + kind: Keyword, + }, + Candidate { + text: "serial", + kind: Keyword, + }, + Candidate { + text: "shortid", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_create_expects_table@after_create.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_create_expects_table@after_create.snap new file mode 100644 index 0000000..df55905 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_create_expects_table@after_create.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create \" cursor=7" +expression: "& a" +--- +Assessment { + input: "create ", + cursor: 7, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "table", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 7, + 7, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "table", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_new_table_name_expects_with@after_new_table_name.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_new_table_name_expects_with@after_new_table_name.snap new file mode 100644 index 0000000..c2e119a --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_new_table_name_expects_with@after_new_table_name.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers \" cursor=23" +expression: "& a" +--- +Assessment { + input: "create table Customers ", + cursor: 23, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "with", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 23, + 23, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "with", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_pk_space_with_col_name_typed_expects_colon@after_col_name.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_pk_space_with_col_name_typed_expects_colon@after_col_name.snap new file mode 100644 index 0000000..5aa2982 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_pk_space_with_col_name_typed_expects_colon@after_col_name.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers with pk Code\" cursor=35" +expression: "& a" +--- +Assessment { + input: "create table Customers with pk Code", + cursor: 35, + state: IncompleteAtEof, + hint: Some( + Prose( + "Next: `:`", + ), + ), + completion: None, + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_table_keyword_offers_no_candidates_for_new_name@after_table_keyword.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_table_keyword_offers_no_candidates_for_new_name@after_table_keyword.snap new file mode 100644 index 0000000..9e040af --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_table_keyword_offers_no_candidates_for_new_name@after_table_keyword.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table \" cursor=13" +expression: "& a" +--- +Assessment { + input: "create table ", + cursor: 13, + state: IncompleteAtEof, + hint: Some( + Prose( + "Type a name", + ), + ), + completion: None, + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_with_expects_pk@after_with.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_with_expects_pk@after_with.snap new file mode 100644 index 0000000..617901f --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__after_with_expects_pk@after_with.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers with \" cursor=28" +expression: "& a" +--- +Assessment { + input: "create table Customers with ", + cursor: 28, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "pk", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 28, + 28, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "pk", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_compound_pk_parses@with_compound_pk.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_compound_pk_parses@with_compound_pk.snap new file mode 100644 index 0000000..b33b5e5 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_compound_pk_parses@with_compound_pk.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Memberships with pk UserId:int, GroupId:int\" cursor=56" +expression: "& a" +--- +Assessment { + input: "create table Memberships with pk UserId:int, GroupId:int", + cursor: 56, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "CreateTable", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_explicit_pk_parses@with_explicit_pk.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_explicit_pk_parses@with_explicit_pk.snap new file mode 100644 index 0000000..56b1215 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_explicit_pk_parses@with_explicit_pk.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers with pk Code:text\" cursor=40" +expression: "& a" +--- +Assessment { + input: "create table Customers with pk Code:text", + cursor: 40, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "CreateTable", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_pk_default_parses@with_pk_default.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_pk_default_parses@with_pk_default.snap new file mode 100644 index 0000000..484490e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_with_pk_default_parses@with_pk_default.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers with pk\" cursor=30" +expression: "& a" +--- +Assessment { + input: "create table Customers with pk", + cursor: 30, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "CreateTable", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_without_with_pk_is_incomplete@no_with_pk.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_without_with_pk_is_incomplete@no_with_pk.snap new file mode 100644 index 0000000..5dce6f7 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__create_table__create_table_without_with_pk_is_incomplete@no_with_pk.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/create_table.rs +description: "input=\"create table Customers\" cursor=22" +expression: "& a" +--- +Assessment { + input: "create table Customers", + cursor: 22, + state: IncompleteAtEof, + hint: Some( + Prose( + "Type a name", + ), + ), + completion: None, + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_offers_only_active_table_columns_no_leakage@after_colon_multi_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_offers_only_active_table_columns_no_leakage@after_colon_multi_table.snap new file mode 100644 index 0000000..036015a --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_offers_only_active_table_columns_no_leakage@after_colon_multi_table.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from Customers: \" cursor=28" +expression: "& a" +--- +Assessment { + input: "drop column from Customers: ", + cursor: 28, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 28, + 28, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_serial_pk_offers_all_columns@after_colon_serial_pk.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_serial_pk_offers_all_columns@after_colon_serial_pk.snap new file mode 100644 index 0000000..babfa55 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_colon_serial_pk_offers_all_columns@after_colon_serial_pk.snap @@ -0,0 +1,55 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from Customers: \" cursor=28" +expression: "& a" +--- +Assessment { + input: "drop column from Customers: ", + cursor: 28, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Email", + kind: Identifier, + }, + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 28, + 28, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Email", + kind: Identifier, + }, + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_drop_column_offers_table_names@after_from.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_drop_column_offers_table_names@after_from.snap new file mode 100644 index 0000000..be5e3f1 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_drop_column_offers_table_names@after_from.snap @@ -0,0 +1,55 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from \" cursor=17" +expression: "& a" +--- +Assessment { + input: "drop column from ", + cursor: 17, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "table", + kind: Keyword, + }, + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 17, + 17, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "table", + kind: Keyword, + }, + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_table_name_expects_colon@after_table_name.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_table_name_expects_colon@after_table_name.snap new file mode 100644 index 0000000..d0e743f --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__after_table_name_expects_colon@after_table_name.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from Customers\" cursor=26" +expression: "& a" +--- +Assessment { + input: "drop column from Customers", + cursor: 26, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 17, + 26, + ), + partial_prefix: "Customers", + candidates: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__complete_drop_column_parses@complete_drop_column.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__complete_drop_column_parses@complete_drop_column.snap new file mode 100644 index 0000000..c968512 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__complete_drop_column_parses@complete_drop_column.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from Customers: Email\" cursor=33" +expression: "& a" +--- +Assessment { + input: "drop column from Customers: Email", + cursor: 33, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "DropColumn", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__drop_column_with_table_keyword_parses@with_table_keyword.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__drop_column_with_table_keyword_parses@with_table_keyword.snap new file mode 100644 index 0000000..5ac8529 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_column__drop_column_with_table_keyword_parses@with_table_keyword.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/drop_column.rs +description: "input=\"drop column from table Customers: Email\" cursor=39" +expression: "& a" +--- +Assessment { + input: "drop column from table Customers: Email", + cursor: 39, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "DropColumn", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap new file mode 100644 index 0000000..ca47fe8 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_child_table_dot_narrows_to_child_columns@after_child_dot.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship from Orders.CustId to Customers.\" cursor=50" +expression: "& a" +--- +Assessment { + input: "drop relationship from Orders.CustId to Customers.", + cursor: 50, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 50, + 50, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_from_offers_table_names@after_from.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_from_offers_table_names@after_from.snap new file mode 100644 index 0000000..14d9e45 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_from_offers_table_names@after_from.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship from \" cursor=23" +expression: "& a" +--- +Assessment { + input: "drop relationship from ", + cursor: 23, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 23, + 23, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap new file mode 100644 index 0000000..287d4d4 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_parent_table_dot_narrows_to_parent_columns@after_parent_dot.snap @@ -0,0 +1,55 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship from Orders.\" cursor=30" +expression: "& a" +--- +Assessment { + input: "drop relationship from Orders.", + cursor: 30, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "CustId", + kind: Identifier, + }, + Candidate { + text: "OrderId", + kind: Identifier, + }, + Candidate { + text: "Total", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 30, + 30, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "CustId", + kind: Identifier, + }, + Candidate { + text: "OrderId", + kind: Identifier, + }, + Candidate { + text: "Total", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_relationship_keyword_offers_from_and_names@after_relationship_keyword.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_relationship_keyword_offers_from_and_names@after_relationship_keyword.snap new file mode 100644 index 0000000..18fccf2 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_relationship_keyword_offers_from_and_names@after_relationship_keyword.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship \" cursor=18" +expression: "& a" +--- +Assessment { + input: "drop relationship ", + cursor: 18, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "from", + kind: Keyword, + }, + Candidate { + text: "Orders_CustId_to_Customers", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 18, + 18, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "from", + kind: Keyword, + }, + Candidate { + text: "Orders_CustId_to_Customers", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_to_offers_table_names@after_to.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_to_offers_table_names@after_to.snap new file mode 100644 index 0000000..5132a64 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__after_to_offers_table_names@after_to.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship from Orders.CustId to \" cursor=40" +expression: "& a" +--- +Assessment { + input: "drop relationship from Orders.CustId to ", + cursor: 40, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 40, + 40, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Customers", + kind: Identifier, + }, + Candidate { + text: "Orders", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_endpoints_parses@complete_by_endpoints.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_endpoints_parses@complete_by_endpoints.snap new file mode 100644 index 0000000..c89eb00 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_endpoints_parses@complete_by_endpoints.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship from Orders.CustId to Customers.id\" cursor=52" +expression: "& a" +--- +Assessment { + input: "drop relationship from Orders.CustId to Customers.id", + cursor: 52, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "DropRelationship", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_name_parses@complete_by_name.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_name_parses@complete_by_name.snap new file mode 100644 index 0000000..e8ecca9 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__drop_relationship__complete_drop_relationship_by_name_parses@complete_by_name.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/drop_relationship.rs +description: "input=\"drop relationship Orders_CustId_to_Customers\" cursor=44" +expression: "& a" +--- +Assessment { + input: "drop relationship Orders_CustId_to_Customers", + cursor: 44, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "DropRelationship", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_colon_narrows_to_active_table_columns@change_after_colon_multi_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_colon_narrows_to_active_table_columns@change_after_colon_multi_table.snap new file mode 100644 index 0000000..78fe14b --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_colon_narrows_to_active_table_columns@change_after_colon_multi_table.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"change column in Customers: \" cursor=28" +expression: "& a" +--- +Assessment { + input: "change column in Customers: ", + cursor: 28, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 28, + 28, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_open_paren_offers_type_candidates@change_after_open_paren.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_open_paren_offers_type_candidates@change_after_open_paren.snap new file mode 100644 index 0000000..bdc54bf --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_after_open_paren_offers_type_candidates@change_after_open_paren.snap @@ -0,0 +1,111 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"change column in Customers: Email (\" cursor=35" +expression: "& a" +--- +Assessment { + input: "change column in Customers: Email (", + cursor: 35, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "text", + kind: Keyword, + }, + Candidate { + text: "int", + kind: Keyword, + }, + Candidate { + text: "real", + kind: Keyword, + }, + Candidate { + text: "decimal", + kind: Keyword, + }, + Candidate { + text: "bool", + kind: Keyword, + }, + Candidate { + text: "date", + kind: Keyword, + }, + Candidate { + text: "datetime", + kind: Keyword, + }, + Candidate { + text: "blob", + kind: Keyword, + }, + Candidate { + text: "serial", + kind: Keyword, + }, + Candidate { + text: "shortid", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 35, + 35, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "text", + kind: Keyword, + }, + Candidate { + text: "int", + kind: Keyword, + }, + Candidate { + text: "real", + kind: Keyword, + }, + Candidate { + text: "decimal", + kind: Keyword, + }, + Candidate { + text: "bool", + kind: Keyword, + }, + Candidate { + text: "date", + kind: Keyword, + }, + Candidate { + text: "datetime", + kind: Keyword, + }, + Candidate { + text: "blob", + kind: Keyword, + }, + Candidate { + text: "serial", + kind: Keyword, + }, + Candidate { + text: "shortid", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_column_with_force_conversion_flag_parses@change_with_force.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_column_with_force_conversion_flag_parses@change_with_force.snap new file mode 100644 index 0000000..fc5a94d --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__change_column_with_force_conversion_flag_parses@change_with_force.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"change column in Customers: Email (int) --force-conversion\" cursor=58" +expression: "& a" +--- +Assessment { + input: "change column in Customers: Email (int) --force-conversion", + cursor: 58, + state: Valid, + hint: Some( + Prose( + "Submit with Enter", + ), + ), + completion: None, + parse_result: Ok( + "ChangeColumnType", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_change_column_parses@complete_change.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_change_column_parses@complete_change.snap new file mode 100644 index 0000000..574125e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_change_column_parses@complete_change.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"change column in Customers: Email (text)\" cursor=40" +expression: "& a" +--- +Assessment { + input: "change column in Customers: Email (text)", + cursor: 40, + state: Valid, + hint: Some( + Candidates { + items: [ + Candidate { + text: "--force-conversion", + kind: Flag, + }, + Candidate { + text: "--dont-convert", + kind: Flag, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 40, + 40, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "--force-conversion", + kind: Flag, + }, + Candidate { + text: "--dont-convert", + kind: Flag, + }, + ], + }, + ), + parse_result: Ok( + "ChangeColumnType", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_rename_column_parses@complete_rename.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_rename_column_parses@complete_rename.snap new file mode 100644 index 0000000..ae806fc --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__complete_rename_column_parses@complete_rename.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"rename column in Customers: Email to ContactEmail\" cursor=49" +expression: "& a" +--- +Assessment { + input: "rename column in Customers: Email to ContactEmail", + cursor: 49, + state: Valid, + hint: Some( + Prose( + "Type a name", + ), + ), + completion: None, + parse_result: Ok( + "RenameColumn", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_colon_narrows_to_active_table_columns@rename_after_colon_multi_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_colon_narrows_to_active_table_columns@rename_after_colon_multi_table.snap new file mode 100644 index 0000000..a232e2e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_colon_narrows_to_active_table_columns@rename_after_colon_multi_table.snap @@ -0,0 +1,47 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"rename column in Customers: \" cursor=28" +expression: "& a" +--- +Assessment { + input: "rename column in Customers: ", + cursor: 28, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 28, + 28, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "Name", + kind: Identifier, + }, + Candidate { + text: "id", + kind: Identifier, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_old_column_expects_to@rename_after_old_column.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_old_column_expects_to@rename_after_old_column.snap new file mode 100644 index 0000000..9fe7921 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_old_column_expects_to@rename_after_old_column.snap @@ -0,0 +1,39 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"rename column in Customers: Email \" cursor=34" +expression: "& a" +--- +Assessment { + input: "rename column in Customers: Email ", + cursor: 34, + state: IncompleteAtEof, + hint: Some( + Candidates { + items: [ + Candidate { + text: "to", + kind: Keyword, + }, + ], + selected: None, + }, + ), + completion: Some( + Completion { + replaced_range: ( + 34, + 34, + ), + partial_prefix: "", + candidates: [ + Candidate { + text: "to", + kind: Keyword, + }, + ], + }, + ), + parse_result: Err( + "Invalid(at_eof)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_to_is_new_name_slot@rename_after_to.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_to_is_new_name_slot@rename_after_to.snap new file mode 100644 index 0000000..ac3b37e --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__rename_change_column__rename_after_to_is_new_name_slot@rename_after_to.snap @@ -0,0 +1,19 @@ +--- +source: tests/typing_surface/rename_change_column.rs +description: "input=\"rename column in Customers: Email to \" cursor=37" +expression: "& a" +--- +Assessment { + input: "rename column in Customers: Email to ", + cursor: 37, + state: IncompleteAtEof, + hint: Some( + Prose( + "Type a name", + ), + ), + completion: None, + parse_result: Err( + "Invalid(at_eof)", + ), +}