(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestIsTextFile(t *testing.T) { |
| 95 | tests := []struct { |
| 96 | filename string |
| 97 | expected bool |
| 98 | }{ |
| 99 | {"test.md", true}, |
| 100 | {"test.txt", true}, |
| 101 | {"test.go", true}, |
| 102 | {"test.py", true}, |
| 103 | {"test.js", true}, |
| 104 | {"test.ts", true}, |
| 105 | {"test.json", true}, |
| 106 | {"test.yaml", true}, |
| 107 | {"test.yml", true}, |
| 108 | {"test.xml", true}, |
| 109 | {"test.html", true}, |
| 110 | {"test.css", true}, |
| 111 | {"test.sh", true}, |
| 112 | {"test.dockerfile", true}, |
| 113 | {"test.gitignore", true}, |
| 114 | {"test.env", true}, |
| 115 | {"test.png", false}, |
| 116 | {"test.jpg", false}, |
| 117 | {"test.jpeg", false}, |
| 118 | {"test.gif", false}, |
| 119 | {"test.exe", false}, |
| 120 | {"test.dll", false}, |
| 121 | {"test.so", false}, |
| 122 | {"test.dylib", false}, |
| 123 | {"test", true}, // No extension should be considered text |
| 124 | {"test.TXT", true}, // Case insensitive |
| 125 | {"test.MD", true}, // Case insensitive |
| 126 | } |
| 127 | |
| 128 | for _, test := range tests { |
| 129 | t.Run(test.filename, func(t *testing.T) { |
| 130 | result := isTextFile(test.filename) |
| 131 | if result != test.expected { |
| 132 | t.Errorf("isTextFile(%s) = %v, expected %v", test.filename, result, test.expected) |
| 133 | } |
| 134 | }) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func TestGitHubAdapter_FetchFiles(t *testing.T) { |
| 139 | // This test would require mocking the GitHub API |
nothing calls this directly
no test coverage detected