Implement mlx and cllm tests and remove redundant code

This commit is contained in:
2025-10-19 19:45:31 +02:00
parent 72fe780e31
commit f42f000539
4 changed files with 390 additions and 254 deletions

View File

@@ -1,5 +1,7 @@
package testutil
import "slices"
// Helper functions for pointer fields
func BoolPtr(b bool) *bool {
return &b
@@ -8,3 +10,23 @@ func BoolPtr(b bool) *bool {
func IntPtr(i int) *int {
return &i
}
// Helper functions for testing command arguments
// Contains checks if a slice contains a specific item
func Contains(slice []string, item string) bool {
return slices.Contains(slice, item)
}
// ContainsFlagWithValue checks if args contains a flag followed by a specific value
func ContainsFlagWithValue(args []string, flag, value string) bool {
for i, arg := range args {
if arg == flag {
// Check if there's a next argument and it matches the expected value
if i+1 < len(args) && args[i+1] == value {
return true
}
}
}
return false
}