Skip to content

Improve unit tests in sectionParser_test.go #202

Open

Description

@SoggyRhino

TestGetInternalClassAndCourseNum, TestGetAcademicSession, TestGetSectionNumber TestParseTimeOrPanic use the following format (or similar) for table driven tests:

fails := []map[string]string{
		{
			"Class Section:": "ENTP33S",
		},
		{
			"Class Section:": "",
		},
		{
			"Class Section:": "Garbage In, Garbage out",
		},
	}

Change it to be a slice by moving the key into a field (i.e. Name). This is better practice as it ensures a deterministic test order.

Change test names to be more descriptive.

A good example can be found [here](https://github.com/UTDNebula/api-tools/blob/develop/parser/requisiteParser_test.go)

Resources

https://pkg.go.dev/testing

Activity

  1. added
    L1
    on Sep 21, 2026
  2. Sidd-Pelluru commented on Sep 25, 2026

    @Sidd-Pelluru

    I am working on this issue, @justinschwerdtfeger

  3. linked a pull request that will close this issueparser - Issue #202(API tools) #214on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

L1recommended for recruits

Type

No type

Fields

Priority

Low

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions