Skip to content

Commit

Permalink
#83: fix meetings tests
Browse files Browse the repository at this point in the history
Signed-off-by: plutov <[email protected]>
  • Loading branch information
plutov committed Feb 22, 2025
1 parent 6359afb commit bc7a222
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions meetings/meetings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestMeetings(t *testing.T) {
{
meetings: []Meeting{
{1, 3, 10},
{2, 4, 15}, // Overlaps, but has more attendees
{2, 4, 15},
{5, 7, 7},
},
rooms: []int{20},
Expand All @@ -41,7 +41,7 @@ func TestMeetings(t *testing.T) {
},
{
meetings: []Meeting{
{1, 3, 100}, // Insufficient Capacity
{1, 3, 100},
{4, 6, 5},
},
rooms: []int{10},
Expand All @@ -65,15 +65,16 @@ func TestMeetings(t *testing.T) {
{
meetings: []Meeting{
{1, 3, 10},
{2, 4, 12}, // Overlaps, higher priority
{2, 4, 12},
{4, 6, 7},
{1, 2, 15}, // Overlaps and needs a larger room, highest priority
{1, 2, 15},
},
rooms: []int{10, 15},
result: []ScheduledMeeting{
{Meeting{1, 2, 15}, 1},
{Meeting{2, 4, 12}, 0},
{Meeting{1, 3, 10}, 0},
{Meeting{2, 4, 12}, 1},
{Meeting{4, 6, 7}, 0},
{Meeting{1, 2, 15}, 1},
},
},
{
Expand Down Expand Up @@ -116,8 +117,8 @@ func TestMeetings(t *testing.T) {
},
rooms: []int{15, 20},
result: []ScheduledMeeting{
{Meeting{1, 2, 16}, 1},
{Meeting{2, 4, 12}, 0},
{Meeting{1, 2, 16}, 1},
{Meeting{6, 7, 5}, 0},
},
},
Expand All @@ -134,7 +135,7 @@ func TestMeetings(t *testing.T) {
}

func BenchmarkMeetings(b *testing.B) {
numMeetings := 1000 // A good starting point for "large"
numMeetings := 1000
numRooms := 50
maxStartTime := 1000
maxDuration := 50
Expand Down

0 comments on commit bc7a222

Please sign in to comment.