()
| 102 | |
| 103 | #[test] |
| 104 | fn test_user_lifecycle() { |
| 105 | let fixture = TestFixture::empty().expect("Failed to create test fixture"); |
| 106 | |
| 107 | // Test CREATE USER |
| 108 | fixture.assert_query_succeeds("CREATE USER 'alice' PASSWORD 'password123'"); |
| 109 | fixture.assert_query_succeeds("CREATE USER 'bob' PASSWORD 'secret456'"); |
| 110 | fixture.assert_query_succeeds("CREATE USER 'charlie' PASSWORD 'pass789'"); |
| 111 | |
| 112 | // Test duplicate user creation should fail |
| 113 | fixture.assert_query_fails("CREATE USER 'alice' PASSWORD 'newpass'", "already exists"); |
| 114 | |
| 115 | // Test CREATE USER IF NOT EXISTS (may not be implemented yet) |
| 116 | let if_not_exists_result = |
| 117 | fixture.query("CREATE USER IF NOT EXISTS 'alice' PASSWORD 'ignored'"); |
| 118 | if if_not_exists_result.is_ok() { |
| 119 | fixture.assert_query_succeeds("CREATE USER IF NOT EXISTS 'diana' PASSWORD 'newpass'"); |
| 120 | } else { |
| 121 | fixture.assert_query_succeeds("CREATE USER 'diana' PASSWORD 'newpass'"); |
| 122 | } |
| 123 | |
| 124 | // Test DROP USER |
| 125 | fixture.assert_query_succeeds("DROP USER 'diana'"); |
| 126 | |
| 127 | // Test DROP USER IF EXISTS |
| 128 | fixture.assert_query_succeeds("DROP USER IF EXISTS 'nonexistent_user'"); |
| 129 | fixture.assert_query_succeeds("DROP USER IF EXISTS 'charlie'"); |
| 130 | |
| 131 | // Test dropping non-existent user should fail without IF EXISTS |
| 132 | fixture.assert_query_fails("DROP USER 'nonexistent_user'", "not found"); |
| 133 | } |
| 134 | |
| 135 | #[test] |
| 136 | fn test_user_listing() { |
nothing calls this directly
no test coverage detected