mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
refactor(dynamic): add framework-aware route detection, improve Rust/Go handler resolution, and expand tests
This commit is contained in:
parent
baa9a36bc6
commit
43ab4aa469
9 changed files with 584 additions and 29 deletions
|
|
@ -128,3 +128,17 @@ fn gin_adapter_ignores_unrelated_function() {
|
|||
let binding = detect_binding(&summary, tree.root_node(), &bytes, Lang::Go);
|
||||
assert!(binding.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gin_adapter_rejects_cache_get_receiver_collision() {
|
||||
let src: &[u8] = b"package main\nimport \"github.com/gin-gonic/gin\"\n\
|
||||
func init() { r := gin.New(); _ = r; cache.Get(\"/run\", Run) }\n\
|
||||
func Run(c interface{}) {}\n";
|
||||
let tree = parse_go(src);
|
||||
let summary = summary_for("Run", "synthetic/gin_cache_collision.go");
|
||||
let binding = detect_binding(&summary, tree.root_node(), src, Lang::Go);
|
||||
assert!(
|
||||
binding.is_none(),
|
||||
"cache.Get must not be treated as a gin route registration"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue