()
| 1815 | #[test] |
| 1816 | #[file_serial] |
| 1817 | fn test_diff_custom_context_lines() { |
| 1818 | let _guard = DirGuard::new(); |
| 1819 | |
| 1820 | let temp_dir = tempfile::tempdir().unwrap(); |
| 1821 | let repo_path = temp_dir.path(); |
| 1822 | |
| 1823 | // Initialize and add a file |
| 1824 | { |
| 1825 | let repo = Repository::init(repo_path).unwrap(); |
| 1826 | std::fs::write( |
| 1827 | repo_path.join("test.txt"), |
| 1828 | "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n", |
| 1829 | ) |
| 1830 | .unwrap(); |
| 1831 | let working_copy = repo.require_working_copy_id().unwrap(); |
| 1832 | repo.add(working_copy, "test.txt", Default::default()) |
| 1833 | .unwrap(); |
| 1834 | } |
| 1835 | |
| 1836 | std::env::set_current_dir(repo_path).unwrap(); |
| 1837 | |
| 1838 | // Use 5 context lines |
| 1839 | let diff = Diff::new().with_context(5); |
| 1840 | let result = diff.run(); |
| 1841 | |
| 1842 | assert!(result.is_ok()); |
| 1843 | } |
| 1844 | } |
nothing calls this directly
no test coverage detected