summary refs log tree commit diff stats
path: root/tests/js/tstreams.nim
blob: 43c26e01a139969afb570c8cb4a2d771531e1b19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
discard """
  output: '''
I
AM
GROOT
'''
"""

import streams

var s = newStringStream("I\nAM\nGROOT")
doAssert s.peekStr(1) == "I"
doAssert s.peekChar() == 'I'
for line in s.lines:
  echo line
s.close

var s2 = newStringStream("abc")
doAssert s2.readAll == "abc"
s2.write("def")
doAssert s2.data == "abcdef"
s2.close
lass="s1">'ranger-master %s\n\nPython %s' % (__version__, sys.version) # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored # and the configuration directory will be $XDG_CONFIG_HOME/ranger instead. CONFDIR = '~/.config/ranger' from ranger.core.main import main # NOQA pylint: disable=wrong-import-position