MCPcopy Create free account
hub / github.com/douglance/devsql / test_query_commits

Function test_query_commits

crates/vcsql/tests/integration.rs:85–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83
84#[test]
85fn test_query_commits() {
86 let temp = create_test_repo();
87 let mut repo = GitRepo::open(temp.path()).expect("Failed to open repo");
88 let mut engine = SqlEngine::new().expect("Failed to create engine");
89
90 engine
91 .load_tables_for_query("SELECT * FROM commits", &mut repo)
92 .expect("Failed to load tables");
93
94 let result = engine
95 .execute("SELECT * FROM commits ORDER BY committed_at DESC")
96 .expect("Failed to execute query");
97
98 assert_eq!(result.row_count(), 2, "Should have 2 commits");
99 assert!(
100 result.columns.contains(&"author_name".to_string()),
101 "Should have author_name column"
102 );
103}
104
105#[test]
106fn test_query_branches() {

Callers

nothing calls this directly

Calls 4

pathMethod · 0.80
load_tables_for_queryMethod · 0.80
create_test_repoFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected