about summary refs log blame commit diff stats
path: root/083scenario_screen_test.mu
blob: c10da8e60abf44bf4442b5c668a472f0c0977e5a (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 [
  assume-screen 3/width, 2/height
  run [
    local-scope
    a:char <- copy 97/a
    screen:&:screen <- print screen:&:screen, a
  ]
  screen-should-contain [
    .a  .
    .   .
  ]
]

scenario clear-line-erases-printed-characters-2 [
  assume-screen 5/width, 3/height
  run [
    local-scope
    # 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
    # clear line
    screen:&:screen <- clear-line screen:&:screen
  ]
  screen-should-contain [
    .     .
    .     .
    .     .
  ]
]