(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestAssignments(t *testing.T) { |
| 51 | set := clause.Assignments(map[string]interface{}{ |
| 52 | "name": "jinzhu", |
| 53 | "age": 18, |
| 54 | }) |
| 55 | |
| 56 | assignments := []clause.Assignment(set) |
| 57 | |
| 58 | sort.Slice(assignments, func(i, j int) bool { |
| 59 | return strings.Compare(assignments[i].Column.Name, assignments[j].Column.Name) > 0 |
| 60 | }) |
| 61 | |
| 62 | if len(assignments) != 2 || assignments[0].Column.Name != "name" || assignments[0].Value.(string) != "jinzhu" || assignments[1].Column.Name != "age" || assignments[1].Value.(int) != 18 { |
| 63 | t.Errorf("invalid assignments, got %v", assignments) |
| 64 | } |
| 65 | } |
nothing calls this directly
no test coverage detected