Matrix: create table, DDL, and app-command coverage
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).
This commit is contained in:
@@ -1 +1,110 @@
|
||||
//! Submodule stub — populated in subsequent tasks.
|
||||
//! Matrix coverage for `add 1:n relationship [as <name>]
|
||||
//! from <P>.<c> to <C>.<c> [on delete <a>] [on update <a>]
|
||||
//! [--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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1 +1,135 @@
|
||||
//! Submodule stub — populated in subsequent tasks.
|
||||
//! Matrix coverage for `create table T with pk [<col>:<type>[, ...]]`
|
||||
//! (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);
|
||||
}
|
||||
|
||||
@@ -1 +1,72 @@
|
||||
//! Submodule stub — populated in subsequent tasks.
|
||||
//! Matrix coverage for `drop column [from] [table] <T> : <col>`
|
||||
//! (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);
|
||||
}
|
||||
|
||||
@@ -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 <name>`
|
||||
//!
|
||||
//! 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);
|
||||
}
|
||||
|
||||
@@ -1 +1,99 @@
|
||||
//! Submodule stub — populated in subsequent tasks.
|
||||
//! Matrix coverage for `rename column [in] [table] <T> : <col>
|
||||
//! to <new>` and `change column [in] [table] <T> : <col>
|
||||
//! ( <type> ) [--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);
|
||||
}
|
||||
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+55
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+41
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+111
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+55
@@ -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)",
|
||||
),
|
||||
}
|
||||
+55
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+55
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+111
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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",
|
||||
),
|
||||
}
|
||||
+19
@@ -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",
|
||||
),
|
||||
}
|
||||
+47
@@ -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)",
|
||||
),
|
||||
}
|
||||
+39
@@ -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)",
|
||||
),
|
||||
}
|
||||
+19
@@ -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)",
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user