summary refs log blame commit diff stats
path: root/testament/tests/shouldfail/tsortoutput.nim
blob: 69dfbc0a04a6d092378218e7cdc90124aa71303a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
           
                  
             


   




                                                            
discard """
  sortoutput: true
  output: '''
2
1
'''
"""

# this test should ensure that the output is actually sorted
echo "2"
echo "1"
6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  cmd: "nimrod js --hints:on $# $#"
"""

# This file tests the JavaScript generator

import
  dom, strutils

# We need to declare the used elements here. This is annoying but
# prevents any kind of typo:
var
  inputElement {.importc: "document.form1.input1", nodecl.}: ref TElement

proc OnButtonClick() {.exportc.} =
  let v = $inputElement.value
  if v.allCharsInSet(whiteSpace):
    echo "only whitespace, hu?"
  else:
    var x = parseInt(v)
    echo x*x

proc OnLoad() {.exportc.} = 
  echo "Welcome! Please take your time to fill in this formular!"