Skip to content

Commit

Permalink
initial test
Browse files Browse the repository at this point in the history
  • Loading branch information
baxiry committed Jul 6, 2024
1 parent 3fe10a7 commit cc4aa47
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions engine/aggregate_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package engine

import (
"testing"
)

const input = `
[
{
"_id": 1,
"name": "karam",
"age": 16,
"tal": 1.2
},
{
"_id": 2,
"name": "bxiry",
"age": 16,
"tal": 1.25
},
{
"_id": 3,
"name": "john",
"age": 17,
"tal": 1.65
},
{
"_id": 4,
"name": "adam",
"age": 34,
"tal": 1.63
},
{
"_id": 5,
"name": "hammam",
"age": 33,
"tal": 1.65
},
{
"_id": 6,
"name": "hisham",
"age": 43,
"tal": 1.66
}
]`

const sortedStr = `[
{
"_id": 4,
"name": "adam",
"age": 34,
"tal": 1.63
},
{
"_id": 5,
"name": "hammam",
"age": 33,
"tal": 1.65
},
{
"_id": 6,
"name": "hisham",
"age": 43,
"tal": 1.66
},
{
"_id": 3,
"name": "john",
"age": 17,
"tal": 1.65
},
{
"_id": 1,
"name": "karam",
"age": 16,
"tal": 1.2
},
{
"_id": 1,
"name": "karam",
"age": 16,
"tal": 1.2
}
]`

func TestSortString(t *testing.T) {
// Test cases with different data and sort key
}

0 comments on commit cc4aa47

Please sign in to comment.