Testing Merge Sort Algorithm Implementation in hello-algo
This test suite validates the implementation of merge sort algorithm in Go, focusing on array sorting functionality. The tests verify the correct ordering of integer arrays using the merge sort approach, ensuring proper sorting behavior and performance.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
krahets/hello-algo
codes/go/chapter_sorting/merge_sort_test.go
// File: merge_sort_test.go
// Created Time: 2022-12-13
// Author: msk397 ([email protected])
package chapter_sorting
import (
"fmt"
"testing"
)
func TestMergeSort(t *testing.T) {
nums := []int{7, 3, 2, 6, 0, 1, 5, 4}
mergeSort(nums, 0, len(nums)-1)
fmt.Println("归并排序完成后 nums = ", nums)
}