()
| 140 | |
| 141 | #[test] |
| 142 | fn test_remove_operations() { |
| 143 | let fixture = TestFixture::new().expect("Failed to create test fixture"); |
| 144 | // Setup fresh graph for this test to avoid interference |
| 145 | fixture |
| 146 | .setup_graph("test_remove_operations") |
| 147 | .expect("Failed to setup graph"); |
| 148 | |
| 149 | // Insert test data |
| 150 | fixture.assert_query_succeeds( |
| 151 | "INSERT (temp:TempNode:ExtraLabel {prop1: 'value1', prop2: 'value2', prop3: 'value3'})", |
| 152 | ); |
| 153 | |
| 154 | // Test property REMOVE |
| 155 | fixture.assert_query_succeeds( |
| 156 | "MATCH (temp:TempNode) |
| 157 | REMOVE temp.prop1, temp.prop2", |
| 158 | ); |
| 159 | |
| 160 | // Verify properties removed |
| 161 | fixture.assert_first_value( |
| 162 | "MATCH (temp:TempNode) |
| 163 | RETURN temp.prop3 as remaining_prop", |
| 164 | "remaining_prop", |
| 165 | Value::String("value3".to_string()), |
| 166 | ); |
| 167 | |
| 168 | // Test label REMOVE |
| 169 | fixture.assert_query_succeeds( |
| 170 | "MATCH (temp:TempNode:ExtraLabel) |
| 171 | REMOVE temp:ExtraLabel", |
| 172 | ); |
| 173 | |
| 174 | // Verify label removed (node should still exist with TempNode label) |
| 175 | fixture.assert_first_value( |
| 176 | "MATCH (temp:TempNode) |
| 177 | WHERE NOT temp:ExtraLabel |
| 178 | RETURN count(temp) as count", |
| 179 | "count", |
| 180 | Value::Number(1.0), |
| 181 | ); |
| 182 | |
| 183 | // Test conditional REMOVE |
| 184 | fixture.assert_query_succeeds( |
| 185 | "INSERT (conditional:ConditionalNode {status: 'temporary', value: 100})", |
| 186 | ); |
| 187 | |
| 188 | fixture.assert_query_succeeds( |
| 189 | "MATCH (c:ConditionalNode) |
| 190 | WHERE c.status = 'temporary' |
| 191 | REMOVE c.status", |
| 192 | ); |
| 193 | |
| 194 | // Verify conditional remove |
| 195 | let result = fixture |
| 196 | .query( |
| 197 | "MATCH (c:ConditionalNode) |
| 198 | RETURN c.status as status", |
| 199 | ) |
nothing calls this directly
no test coverage detected