about summary refs log blame commit diff stats
path: root/archive/2.vm/083scenario_screen_test.mu
blob: b4ac6e5e8f01ed5acb0f78dfc032ea448514130a (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 <- print 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 <- print screen, a
  # move cursor to start of line
  screen <- move-cursor screen, 0/row, 0/column
  run [
    screen <- clear-line screen
  ]
  screen-should-contain [
    .     .
    .     .
    .     .
  ]
]

scenario scroll-screen [
  local-scope
  assume-screen 3/width, 2/height
  run [
    a:char <- copy 97/a
    move-cursor screen, 1/row, 2/column
    screen <- print screen, a
    screen <- print screen, a
  ]
  screen-should-contain [
    .  a.
    .a  .
  ]
]