ycl

Artifact [30bc4eea79]
Login

Artifact [30bc4eea79]

Artifact 30bc4eea799788a60f3d7bcfbbfdd69c096e5233:



package require {ycl ns}
namespace import [yclprefix]::ns::nsnormalize
package require ycl::parse::r
interp alias {} [namespace current]::r {} ycl::parse::r
namespace import [yclprefix]::parse::r::parser

package require tcl::chan::string

package require ycl::test::data
package require ycl::test
ycl::test::init


proc suite_main {} {
	foreach var [info vars [namespace current]::*] {
		variable $var
	}
	test one {} -setup $setup1 -body {
		parser parser1 $chan
		while {[namespace which parser1] eq "[nsnormalize [namespace current]::parser1]"} {
			parser1
		}
	} -cleanup $cleanup1 -result hmph

	test is_reserved {} -setup $setup1 -body {
		foreach string $syntax {
			lappend res [r is reserved $string]
		}
		set res
	} -cleanup $cleanup1 -result {0 0 0 1 1 1 1 0 0} 

	test is_specialops {} -setup $setup1 -body {
		foreach string $syntax {
			lappend res [r is specialops $string]
		}
		set res
	} -cleanup $cleanup1 -result {{} {} {} {} {} {} {} %in% %uber%} 

	cleanupTests
}

variable setup1 {
	set res [list]
	set chan [tcl::chan::string $rscript]
}

variable cleanup1 {
	close $chan
}

variable rscript {
	c("hello", "there" ,"Bob")
	c(1 ,2 3)
}

variable syntax {
	hello
	1
	.hello
	.
	.1
	..
	..2
	%in%
	%uber%
}