Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in isSet function is returning false when a value is set #366

Open
bashbunni opened this issue Sep 16, 2024 · 1 comment
Open

Built-in isSet function is returning false when a value is set #366

bashbunni opened this issue Sep 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bashbunni
Copy link
Member

Describe the bug
Built-in isSet function is returning false when a value is set. This impacts GetBorderLeft and border rendering when setting a custom border.

To Reproduce
Add the source code to a test file, then run go test -run TestIsSet

Source Code

func TestIsSet(t *testing.T) {
	leftOnly := NewStyle().
		BorderStyle(Border{Left: "   new             "}).
		BorderForeground(Color("#FFA500"))
	got := leftOnly.isSet(borderLeftKey)
	if got != true {
		t.Fatalf("expected the left border to be set, got: %#v, but the left border is: %#v", got, leftOnly.borderStyle.Left)
	}
}

gives:

--- FAIL: TestIsSet (0.00s)
    style_test.go:550: expected the left border to be set, got: false, but the left border is: "   new             "
FAIL

Expected behavior
I would expect the borderLeftKey to be set

Additional context
This is likely related to other reported border and frame size issues.

@unamdev0
Copy link

Hi @bashbunni, I've created a PR for this,can you please check
#380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants