[PR #441] Box: add tests #954

Open
opened 2026-03-04 01:08:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/441
Author: @Konstantin8105
Created: 5/2/2020
Status: 🔄 Open

Base: masterHead: master


📝 Commits (2)

📊 Changes

6 files changed (+121 additions, -0 deletions)

View changed files

box_test.go (+96 -0)
screen/box.AlignCenter (+5 -0)
screen/box.AlignLeft (+5 -0)
screen/box.AlignRight (+5 -0)
screen/box.Bold.Border (+5 -0)
screen/box.Simple (+5 -0)

📄 Description

That PR is prototype for creating the tests.
Tests run in parallel for minimaze test time.
For check - run in console:

go test -v -cover

Output:

$ go test -v -cover
=== RUN   TestBox
=== RUN   TestBox/box.Simple
=== PAUSE TestBox/box.Simple
=== RUN   TestBox/box.Bold.Border
=== PAUSE TestBox/box.Bold.Border
=== RUN   TestBox/box.AlignLeft
=== PAUSE TestBox/box.AlignLeft
=== RUN   TestBox/box.AlignRight
=== PAUSE TestBox/box.AlignRight
=== RUN   TestBox/box.AlignCenter
=== PAUSE TestBox/box.AlignCenter
=== CONT  TestBox/box.Simple
=== CONT  TestBox/box.AlignRight
=== CONT  TestBox/box.AlignCenter
=== CONT  TestBox/box.AlignLeft
=== CONT  TestBox/box.Bold.Border
--- PASS: TestBox (0.00s)
    --- PASS: TestBox/box.Simple (1.00s)
    --- PASS: TestBox/box.AlignRight (1.00s)
    --- PASS: TestBox/box.AlignLeft (1.00s)
    --- PASS: TestBox/box.AlignCenter (1.00s)
    --- PASS: TestBox/box.Bold.Border (1.00s)
PASS
coverage: 5.6% of statements
ok  	github.com/rivo/tview	2.006s

If you add some test and want to update screens , then run UPDATE=true go test and after that screens are updated.

Feel free for merge and reject.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/441 **Author:** [@Konstantin8105](https://github.com/Konstantin8105) **Created:** 5/2/2020 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`28f45a4`](https://github.com/rivo/tview/commit/28f45a491427f088391304e9ff3f1e5862d529f6) box: add test - [`82dfff0`](https://github.com/rivo/tview/commit/82dfff074c72e9f6ff9d21774beeac012ed7d0b5) box: add test comment ### 📊 Changes **6 files changed** (+121 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `box_test.go` (+96 -0) ➕ `screen/box.AlignCenter` (+5 -0) ➕ `screen/box.AlignLeft` (+5 -0) ➕ `screen/box.AlignRight` (+5 -0) ➕ `screen/box.Bold.Border` (+5 -0) ➕ `screen/box.Simple` (+5 -0) </details> ### 📄 Description That PR is prototype for creating the tests. Tests run in parallel for minimaze test time. For check - run in console: ``` go test -v -cover ``` Output: ``` $ go test -v -cover === RUN TestBox === RUN TestBox/box.Simple === PAUSE TestBox/box.Simple === RUN TestBox/box.Bold.Border === PAUSE TestBox/box.Bold.Border === RUN TestBox/box.AlignLeft === PAUSE TestBox/box.AlignLeft === RUN TestBox/box.AlignRight === PAUSE TestBox/box.AlignRight === RUN TestBox/box.AlignCenter === PAUSE TestBox/box.AlignCenter === CONT TestBox/box.Simple === CONT TestBox/box.AlignRight === CONT TestBox/box.AlignCenter === CONT TestBox/box.AlignLeft === CONT TestBox/box.Bold.Border --- PASS: TestBox (0.00s) --- PASS: TestBox/box.Simple (1.00s) --- PASS: TestBox/box.AlignRight (1.00s) --- PASS: TestBox/box.AlignLeft (1.00s) --- PASS: TestBox/box.AlignCenter (1.00s) --- PASS: TestBox/box.Bold.Border (1.00s) PASS coverage: 5.6% of statements ok github.com/rivo/tview 2.006s ``` If you add some test and want to update `screens` , then run `UPDATE=true go test` and after that `screens` are updated. Feel free for merge and reject. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#954
No description provided.