about summary refs log blame commit diff stats
path: root/083scenario_screen_test.mu
blob: a21a9fdf402a13c74479e3a1b06e9d9bd3a6f934 (plain) (tree)
1
2
3
4
5
6
7
8

                                                                            
                                        
             
                                 
       
                       
                                               






                         
                                      
# To check our support for screens in scenarios, rewrite tests from print.mu

scenario print-character-at-top-left-2 [
  local-scope
  assume-screen 3/width, 2/height
  run [
    a:char <- copy 97/a
    screen:&:screen <- print screen:&:screen, a
  ]
  screen-should-contain [
    .a  .
    .   .
  ]
]

scenario clear-line-erases-printed-characters-2 [
  local-scope
  assume-screen 5/width, 3/height
  # print a character
  a:char <- copy 97/a
  screen:&:screen <- print screen:&:screen, a
  # move cursor to start of line
  screen:&:screen <- move-cursor screen:&:screen, 0/row, 0/column
  run [
    screen:&:screen <- clear-line screen:&:screen
  ]
  screen-should-contain [
    .     .
    .     .
    .     .
  ]
]
/span>margin-top: unset; margin-bottom: unset; } blockquote { margin: 1em; } q::before { content: open-quote; } q::after { content: close-quote; } table { display: table; border-spacing: 0.5ch 0; padding-left: 0.5ch; padding-right: 0.5ch; } tbody { display: table-row-group; vertical-align: middle; } thead { display: table-header-group; } tfoot { display: table-footer-group; } colgroup { display: table-column-group; } tr { display: table-row; vertical-align: inherit; } col { display: table-column; } th { display: table-cell; font-weight: bold; vertical-align: inherit; } td { display: table-cell; text-align: unset; vertical-align: inherit; } caption { display: table-caption; text-align: center; } caption[align=top] { caption-side: top; } caption[align=bottom] { caption-side: bottom; } caption[align=left] { caption-side: left; } caption[align=right] { caption-side: right; } input { margin-right: 1ch; white-space: pre; color: red; } input[type="hidden"] { display: none; } input::before { content: '['; text-decoration: none; color: initial; } input::after { content: ']'; text-decoration: none; color: initial; } input[type="radio"]::before { content: '('; text-decoration: none; color: initial; } input[type="radio"]::after { content: ')'; text-decoration: none; color: initial; } input:is([type="text"], [type="password"], [type="search"], [type="file"], [type="url"], [type="email"], [type="tel"]) { text-decoration: underline; } input:is([type="submit"], [type="button"], [type="reset"])::before { color: red; } input:is([type="submit"], [type="button"], [type="reset"])::after { color: red; } button { color: red; } textarea { color: red; white-space: pre; } li { display: list-item; } i, em { font-style: italic; } b, strong { font-weight: bold; } u, ins { text-decoration: underline; } h1, h2, h3, h4, h5, h6 { margin-top: 1em; margin-bottom: 1em; font-weight: bold; } pre { margin-top: 1em; margin-bottom: 1em; white-space: pre; } p { margin-top: 1em; margin-bottom: 1em; } a[href] { color: yellow; } a[href]:hover { text-decoration: underline; } sup::before { content: '^'; } sub::before { content: '~'; } ol { list-style-type: decimal; counter-reset: list-item 0; } ul { list-style-type: disc; counter-reset: list-item 0; } :is(ol, ul, menu, dir) ul { list-style-type: circle; } :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) ul { list-style-type: square; } dl { margin-bottom: 1em; } :is(ul, ol, dir, menu, dl) dl { margin-bottom: unset; } dt { font-weight: bold; } dd { margin-left: 4ch; } dl[compact] dt + br { display: none; } select { display: inline-block; } select:focus { visibility: hidden; } select::before { content: '['; color: initial; display: inline-block; } select::after { content: ']'; color: initial; display: inline-block; } select > :is(option, optgroup > option) { display: none; } select > :is(option, optgroup > option):checked { display: inline-block; color: red; } select[multiple] > :is(option, optgroup > option):first-child { display: inline-block; } select[multiple] > :is(option, optgroup > option):not(:checked):first-child::after { content: '(...)'; } select[multiple] > :is(option, optgroup > option):not(:first-child):checked::before { content: ','; } center { text-align: -cha-center; } blink { text-decoration: blink; } s, strike { text-decoration: line-through; } rt::before { content: '('; } rt::after { content: ')'; }