run sgr-full and sgr-direct in test suite #1138

This commit is contained in:
nick black 2020-11-27 15:38:36 -05:00
parent f82ad10667
commit b7ea4e2359
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
4 changed files with 21 additions and 6 deletions

View File

@ -538,6 +538,14 @@ add_test(
NAME ncpp_build_exceptions NAME ncpp_build_exceptions
COMMAND ncpp_build_exceptions COMMAND ncpp_build_exceptions
) )
add_test(
NAME sgr-full
COMMAND sgr-full
)
add_test(
NAME sgr-direct
COMMAND sgr-direct
)
add_test( add_test(
NAME rgb NAME rgb
COMMAND rgb COMMAND rgb

View File

@ -1696,7 +1696,7 @@ int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
// Release resources held by the cell 'c'. // Release resources held by the cell 'c'.
void cell_release(struct ncplane* n, cell* c); void cell_release(struct ncplane* n, cell* c);
#define NCSTYLE_MASK 0xfffful #define NCSTYLE_MASK 0x03fful
#define NCSTYLE_STANDOUT 0x0080ul #define NCSTYLE_STANDOUT 0x0080ul
#define NCSTYLE_UNDERLINE 0x0040ul #define NCSTYLE_UNDERLINE 0x0040ul
#define NCSTYLE_REVERSE 0x0020ul #define NCSTYLE_REVERSE 0x0020ul

View File

@ -605,7 +605,7 @@ API int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
// Release resources held by the cell 'c'. // Release resources held by the cell 'c'.
API void cell_release(struct ncplane* n, cell* c); API void cell_release(struct ncplane* n, cell* c);
#define NCSTYLE_MASK 0xffffu #define NCSTYLE_MASK 0x03ffu
#define NCSTYLE_STANDOUT 0x0080u #define NCSTYLE_STANDOUT 0x0080u
#define NCSTYLE_UNDERLINE 0x0040u #define NCSTYLE_UNDERLINE 0x0040u
#define NCSTYLE_REVERSE 0x0020u #define NCSTYLE_REVERSE 0x0020u

View File

@ -3,13 +3,17 @@
#include <notcurses/notcurses.h> #include <notcurses/notcurses.h>
int main(void){ int main(void){
struct notcurses* nc = notcurses_init(NULL, NULL); struct notcurses_options nopts = {
.flags = NCOPTION_NO_ALTERNATE_SCREEN,
};
struct notcurses* nc = notcurses_init(&nopts, NULL);
if(nc == NULL){ if(nc == NULL){
return EXIT_FAILURE; return EXIT_FAILURE;
} }
int dimy, dimx; int dimy, dimx;
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx); struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
int y = 0; int y = 0;
// FIXME do full permutations?
ncplane_set_styles(n, NCSTYLE_NONE); ncplane_set_styles(n, NCSTYLE_NONE);
ncplane_putstr_yx(n, y++, 0, "a ═ none"); ncplane_putstr_yx(n, y++, 0, "a ═ none");
ncplane_set_styles(n, NCSTYLE_ITALIC); ncplane_set_styles(n, NCSTYLE_ITALIC);
@ -23,7 +27,7 @@ int main(void){
ncplane_set_styles(n, NCSTYLE_BLINK); ncplane_set_styles(n, NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ blink"); ncplane_putstr_yx(n, y++, 0, "a ═ blink");
ncplane_set_styles(n, NCSTYLE_STRUCK); ncplane_set_styles(n, NCSTYLE_STRUCK);
ncplane_putstr_yx(n, y++, 0, "a ═ strikethrough"); ncplane_putstr_yx(n, y++, 0, "a ═ struck");
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_BOLD); ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_BOLD);
ncplane_putstr_yx(n, y++, 0, "a ═ italic bold"); ncplane_putstr_yx(n, y++, 0, "a ═ italic bold");
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_REVERSE); ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_REVERSE);
@ -48,11 +52,14 @@ int main(void){
ncplane_putstr_yx(n, y++, 0, "a ═ bold underline"); ncplane_putstr_yx(n, y++, 0, "a ═ bold underline");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK); ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ bold blink"); ncplane_putstr_yx(n, y++, 0, "a ═ bold blink");
ncplane_putstr_yx(n, y++, 0, "sleeping for 15s..."); ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_REVERSE | NCSTYLE_UNDERLINE |
NCSTYLE_BLINK | NCSTYLE_ITALIC | NCSTYLE_STRUCK);
ncplane_putstr_yx(n, y++, 0, "a ═ whoomp! there it is");
ncplane_set_styles(n, NCSTYLE_NONE);
if(notcurses_render(nc)){ if(notcurses_render(nc)){
goto err; goto err;
} }
sleep(15);
if(notcurses_stop(nc)){ if(notcurses_stop(nc)){
return EXIT_FAILURE; return EXIT_FAILURE;
} }