mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
test: add JavaScript fixture and update comment pattern tests
This commit is contained in:
parent
5d5fed62f2
commit
cbadfd59db
2 changed files with 34 additions and 4 deletions
|
@ -6,14 +6,17 @@ from aider.watch import FileWatcher
|
||||||
def test_ai_comment_pattern():
|
def test_ai_comment_pattern():
|
||||||
# Test various AI comment patterns
|
# Test various AI comment patterns
|
||||||
test_comments = [
|
test_comments = [
|
||||||
|
# Python style
|
||||||
"# ai do something",
|
"# ai do something",
|
||||||
"# AI make this better",
|
"# AI make this better",
|
||||||
"# ai! urgent change needed",
|
"# ai! urgent change needed",
|
||||||
"# AI! another urgent one",
|
"# AI! another urgent one",
|
||||||
"//ai javascript style",
|
# JavaScript style
|
||||||
"//AI do that thing",
|
"//ai do something",
|
||||||
"//ai! urgent js thing",
|
"//AI make this better",
|
||||||
"// ai with some space",
|
"//ai! urgent change needed",
|
||||||
|
"//AI! another urgent one",
|
||||||
|
"// ai with space",
|
||||||
"// AI with caps",
|
"// AI with caps",
|
||||||
"// ai! with bang",
|
"// ai! with bang",
|
||||||
]
|
]
|
||||||
|
|
27
tests/fixtures/watch.js
vendored
Normal file
27
tests/fixtures/watch.js
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// Regular AI comment
|
||||||
|
//ai do something
|
||||||
|
//AI make this better
|
||||||
|
//ai! urgent change needed
|
||||||
|
//AI! another urgent one
|
||||||
|
// ai with space
|
||||||
|
// AI with caps
|
||||||
|
// ai! with bang
|
||||||
|
// this is not an ai comment
|
||||||
|
// aider is not an ai comment
|
||||||
|
|
||||||
|
function dummyFunction() {
|
||||||
|
// ai inside function
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Example {
|
||||||
|
constructor() {
|
||||||
|
// ai in constructor
|
||||||
|
this.value = 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
method() {
|
||||||
|
// ai in method
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue