Lines Matching defs:edit
24 #include "edit-context.h"
42 /* Forward decls. class edit_context is declared within edit-context.h.
175 /* Class for representing edit events that have occurred on one line of
910 edit_context edit;
911 auto_free <char *> result = edit.get_content (tmp.get_filename ());
921 edit_context edit;
922 auto_free <char *> result = edit.get_content (tmp.get_filename ());
934 edit_context edit;
935 auto_free <char *> result = edit.get_content (tmp.get_filename ());
967 edit_context edit;
968 edit.add_fixits (&richloc);
969 auto_free <char *> new_content = edit.get_content (filename);
976 ASSERT_EQ (100, edit.get_effective_column (filename, 1, 100));
977 ASSERT_EQ (100, edit.get_effective_column (filename, 3, 100));
980 ASSERT_EQ (1, edit.get_effective_column (filename, 2, 1));
981 ASSERT_EQ (6, edit.get_effective_column (filename, 2, 6));
984 ASSERT_EQ (21, edit.get_effective_column (filename, 2, 7));
985 ASSERT_EQ (22, edit.get_effective_column (filename, 2, 8));
988 auto_free <char *> diff = edit.generate_diff (false);
1025 edit_context edit;
1026 edit.add_fixits (&richloc);
1027 auto_free <char *> new_content = edit.get_content (filename);
1033 auto_free <char *> diff = edit.generate_diff (false);
1067 edit_context edit;
1068 edit.add_fixits (&richloc);
1069 auto_free <char *> new_content = edit.get_content (filename);
1075 auto_free <char *> diff = edit.generate_diff (false);
1125 edit_context edit;
1126 edit.add_fixits (&richloc);
1127 ASSERT_FALSE (edit.valid_p ());
1128 ASSERT_EQ (NULL, edit.get_content (filename));
1129 ASSERT_EQ (NULL, edit.generate_diff (false));
1162 edit_context edit;
1163 edit.add_fixits (&richloc);
1164 auto_free <char *> new_content = edit.get_content (filename);
1173 auto_free <char *> diff = edit.generate_diff (false);
1206 edit_context edit;
1207 edit.add_fixits (&richloc);
1208 auto_free <char *> new_content = edit.get_content (filename);
1216 ASSERT_EQ (18, edit.get_effective_column (filename, 2, 16));
1219 auto_free <char *> diff = edit.generate_diff (false);
1251 edit_context edit;
1252 edit.add_fixits (&richloc);
1253 auto_free <char *> new_content = edit.get_content (filename);
1261 ASSERT_EQ (16, edit.get_effective_column (filename, 2, 18));
1264 auto_free <char *> diff = edit.generate_diff (false);
1305 edit_context edit;
1306 edit.add_fixits (&richloc);
1307 auto_free <char *> new_content = edit.get_content (filename);
1336 edit_context edit;
1337 edit.add_fixits (&richloc);
1338 auto_free <char *> new_content = edit.get_content (filename);
1346 ASSERT_EQ (10, edit.get_effective_column (filename, 2, 18));
1349 auto_free <char *> diff = edit.generate_diff (false);
1401 edit_context edit;
1402 edit.add_fixits (&insert_a);
1403 ASSERT_EQ (100, edit.get_effective_column (filename, 1, 100));
1404 ASSERT_EQ (1, edit.get_effective_column (filename, 2, 1));
1405 ASSERT_EQ (6, edit.get_effective_column (filename, 2, 6));
1406 ASSERT_EQ (18, edit.get_effective_column (filename, 2, 7));
1407 ASSERT_EQ (27, edit.get_effective_column (filename, 2, 16));
1408 ASSERT_EQ (100, edit.get_effective_column (filename, 3, 100));
1410 edit.add_fixits (&insert_b);
1411 edit.add_fixits (&replace_a);
1412 edit.add_fixits (&replace_b);
1416 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1423 auto_free <char *> diff = edit.generate_diff (false);
1436 change_line (edit_context &edit, int line_num)
1454 edit.add_fixits (&insert);
1462 insert_line (edit_context &edit, int line_num)
1480 edit.add_fixits (&insert);
1503 edit_context edit;
1506 change_line (edit, 2);
1507 change_line (edit, 3);
1508 change_line (edit, 4);
1509 insert_line (edit, 5);
1512 change_line (edit, 150);
1513 change_line (edit, 151);
1514 location_t last_loc = change_line (edit, 153);
1520 auto_free <char *> diff = edit.generate_diff (false);
1591 edit_context edit;
1592 edit.add_fixits (&r1);
1596 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1605 ASSERT_EQ (6, edit.get_effective_column (filename, 2, 8));
1607 ASSERT_EQ (9, edit.get_effective_column (filename, 2, 11));
1610 edit.add_fixits (&r2);
1612 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1624 edit_context edit;
1625 edit.add_fixits (&r2);
1626 edit.add_fixits (&r1);
1627 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1652 edit_context edit;
1654 should transition the edit from valid to invalid. */
1655 ASSERT_TRUE (edit.valid_p ());
1656 edit.add_fixits (&insert);
1657 ASSERT_FALSE (edit.valid_p ());
1658 ASSERT_EQ (NULL, edit.get_content (filename));
1659 ASSERT_EQ (NULL, edit.generate_diff (false));
1662 /* Verify that we gracefully handle an attempt to edit a line
1685 edit_context edit;
1686 ASSERT_TRUE (edit.valid_p ());
1687 edit.add_fixits (&insert);
1688 ASSERT_FALSE (edit.valid_p ());
1689 ASSERT_EQ (NULL, edit.get_content (filename));
1690 ASSERT_EQ (NULL, edit.generate_diff (false));
1722 edit_context edit;
1723 edit.add_fixits (&richloc);
1724 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1738 edit_context edit;
1739 ASSERT_TRUE (edit.valid_p ());
1740 edit.add_fixits (&richloc);
1741 ASSERT_FALSE (edit.valid_p ());
1742 ASSERT_EQ (NULL, edit.get_content (filename));
1743 ASSERT_EQ (NULL, edit.generate_diff (false));
1756 edit_context edit;
1757 edit.add_fixits (&richloc);
1758 auto_free <char *> new_content = edit.get_content (tmp.get_filename ());
1773 edit_context edit;
1774 ASSERT_TRUE (edit.valid_p ());
1775 edit.add_fixits (&richloc);
1776 ASSERT_FALSE (edit.valid_p ());
1777 ASSERT_EQ (NULL, edit.get_content (filename));
1778 ASSERT_EQ (NULL, edit.generate_diff (false));