Demonstrate the convenience has_changed function.
()
| 199 | |
| 200 | |
| 201 | def demo_convenience_function() -> None: |
| 202 | """Demonstrate the convenience has_changed function.""" |
| 203 | print("\n=== Convenience Function Demo ===") |
| 204 | |
| 205 | with tempfile.TemporaryDirectory() as temp_dir: |
| 206 | temp_path = Path(temp_dir) |
| 207 | cache_file = temp_path / "convenience_cache.json" |
| 208 | |
| 209 | # Create test file |
| 210 | test_file = temp_path / "test.h" |
| 211 | with open(test_file, "w") as f: |
| 212 | f.write("#pragma once\n#define API_VERSION 1") |
| 213 | |
| 214 | baseline_time = time.time() - 1800 # 30 minutes ago |
| 215 | |
| 216 | # Use convenience function |
| 217 | changed = has_changed(test_file, baseline_time, cache_file) |
| 218 | print(f"Convenience function result: {changed}") |
| 219 | print(f"Cache file created: {cache_file.exists()}") |
| 220 | |
| 221 | |
| 222 | if __name__ == "__main__": |
no test coverage detected