diff options
-rw-r--r-- | test/tc_interpreter.rb | 34 | ||||
-rw-r--r-- | test/tc_lexer.rb | 87 | ||||
-rw-r--r-- | test/tc_parser.rb | 29 | ||||
-rw-r--r-- | test/text/assignments | 9 | ||||
-rw-r--r-- | test/text/facts | 9 | ||||
-rw-r--r-- | test/text/functions | 3 | ||||
-rw-r--r-- | test/text/groups | 7 | ||||
-rw-r--r-- | test/text/one | 5 | ||||
-rw-r--r-- | test/text/selectors | 27 | ||||
-rw-r--r-- | test/ts_parsing.rb | 5 |
10 files changed, 0 insertions, 215 deletions
diff --git a/test/tc_interpreter.rb b/test/tc_interpreter.rb deleted file mode 100644 index c3c9fc6c9..000000000 --- a/test/tc_interpreter.rb +++ /dev/null @@ -1,34 +0,0 @@ -$:.unshift '../lib' if __FILE__ == $0 # Make this library first! - -require 'blink' -require 'blink/parser/parser' -require 'test/unit' -require 'blinktest.rb' - -# $Id$ - -class TestInterpreter < Test::Unit::TestCase - # hmmm - # this is complicated, because we store references to the created - # objects in a central store - def setup - Blink.init(:debug => 1) - #@lexer = Blink::Parser::Lexer.new() - @parser = Blink::Parser::Parser.new() - end - - def test_files - textfiles { |file| - Blink.debug("parsing %s" % file) - interpreter = nil - assert_nothing_raised() { - @parser.file = file - interpreter = @parser.parse - #p interpreter - } - assert_nothing_raised() { - interpreter.run() - } - } - end -end diff --git a/test/tc_lexer.rb b/test/tc_lexer.rb deleted file mode 100644 index 2c1c25dee..000000000 --- a/test/tc_lexer.rb +++ /dev/null @@ -1,87 +0,0 @@ -$:.unshift '../lib' if __FILE__ == $0 # Make this library first! - -require 'blink' -require 'blink/parser/lexer' -require 'test/unit' -require 'blinktest.rb' - -# $Id$ - -#%q{service("telnet") = \{ -# port => "23", -# protocol => "tcp", -# name => "telnet", -#\} -#} => [[:WORD, "service"], [:LPAREN, "("], [:DQUOTE, "\""], [:WORD, "telnet"], [:DQUOTE, "\""], [:RPAREN, ")"], [:EQUALS, "="], [:lbrace, "{"], [:WORD, "port"], [:FARROW, "=>"], [:DQUOTE, "\""], [:WORD, "23"], [:DQUOTE, "\""], [:COMMA, ","], [:WORD, "protocol"], [:FARROW, "=>"], [:DQUOTE, "\""], [:WORD, "tcp"], [:DQUOTE, "\""], [:COMMA, ","], [:WORD, "name"], [:FARROW, "=>"], [:DQUOTE, "\""], [:WORD, "telnet"], [:DQUOTE, "\""], [:COMMA, ","], [:RBRACE, "}"]] - -class TestLexer < Test::Unit::TestCase - def setup - Blink.init(:debug => 1) - @lexer = Blink::Parser::Lexer.new() - end - - def test_simple_lex - strings = { -%q{\\} => [[:BACKSLASH,"\\"],[false,false]], -%q{simplest scanner test} => [[:WORD,"simplest"],[:WORD,"scanner"],[:WORD,"test"],[false,false]], -%q{returned scanner test -} => [[:WORD,"returned"],[:WORD,"scanner"],[:WORD,"test"],[false,false]] - } - strings.each { |str,ary| - @lexer.string = str - assert_equal( - ary, - @lexer.fullscan() - ) - } - end - - def test_quoted_strings - strings = { -%q{a simple "scanner" test -} => [[:WORD,"a"],[:WORD,"simple"],[:QTEXT,"scanner"],[:WORD,"test"],[false,false]], -%q{a harder "scanner test" -} => [[:WORD,"a"],[:WORD,"harder"],[:QTEXT,"scanner test"],[false,false]], -%q{a hardest "scanner \"test\"" -} => [[:WORD,"a"],[:WORD,"hardest"],[:QTEXT,'scanner "test"'],[false,false]], -%q{function("call")} => [[:WORD,"function"],[:LPAREN,"("],[:QTEXT,'call'],[:RPAREN,")"],[false,false]] -} - strings.each { |str,array| - @lexer.string = str - assert_equal( - array, - @lexer.fullscan() - ) - } - end - - def test_errors - strings = %w{ - ^ - @ - < - > - } - strings.each { |str| - @lexer.string = str - assert_raise(RuntimeError) { - @lexer.fullscan() - } - } - end - - def test_more_error - assert_raise(TypeError) { - @lexer.fullscan() - } - end - - def test_files - textfiles() { |file| - @lexer.file = file - assert_nothing_raised() { - @lexer.fullscan() - } - } - end -end diff --git a/test/tc_parser.rb b/test/tc_parser.rb deleted file mode 100644 index 40fcac3fa..000000000 --- a/test/tc_parser.rb +++ /dev/null @@ -1,29 +0,0 @@ -$:.unshift '../lib' if __FILE__ == $0 # Make this library first! - -require 'blink' -require 'blink/parser/parser' -require 'test/unit' -require 'blinktest.rb' - -# $Id$ - -class TestParser < Test::Unit::TestCase - # hmmm - # this is complicated, because we store references to the created - # objects in a central store - def setup - Blink.init(:debug => 1, :parseonly => true) - #@lexer = Blink::Parser::Lexer.new() - @parser = Blink::Parser::Parser.new() - end - - def test_each_file - textfiles { |file| - Blink.debug("parsing %s" % file) - assert_nothing_raised() { - @parser.file = file - @parser.parse - } - } - end -end diff --git a/test/text/assignments b/test/text/assignments deleted file mode 100644 index f45b83392..000000000 --- a/test/text/assignments +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ - -platform = :sunos - -platform = "this is a string of text" - -apache = service["apache"] { - :running => "1" -} diff --git a/test/text/facts b/test/text/facts deleted file mode 100644 index a1562dc82..000000000 --- a/test/text/facts +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ - -fact["videocard"] { - :interpreter => "/bin/sh", - :code => "lspci | grep VGA", - :os => "Linux" -} -platform = retrieve("platform") -card = retrieve("videocard") diff --git a/test/text/functions b/test/text/functions deleted file mode 100644 index 6d295bdb1..000000000 --- a/test/text/functions +++ /dev/null @@ -1,3 +0,0 @@ -# $Id$ - -platform = retrieve("platform") diff --git a/test/text/groups b/test/text/groups deleted file mode 100644 index 56690eefb..000000000 --- a/test/text/groups +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -# there need to be two forms of adding to groups: -# add the current host to a group, and add a list of hosts to a -# group by name - -group = "crap" diff --git a/test/text/one b/test/text/one deleted file mode 100644 index 12394b72d..000000000 --- a/test/text/one +++ /dev/null @@ -1,5 +0,0 @@ -# $Id$ - -service["sleeper"] { - :running => "1", -} diff --git a/test/text/selectors b/test/text/selectors deleted file mode 100644 index 7a2b26357..000000000 --- a/test/text/selectors +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ - -platform = :sunos - -funtest = platform ? { - :sunos => "yayness" - :aix => :goodness - :default => "badness" -} - -# this is a comment - -sleeper = service["sleeper"] { - :owner => platform ? { - :sunos => "luke" - :default => "root" - }, - # this is a bit retarded, because we'll get a null value if we're not on sunos - # but we don't currently allow selectors as parameter statements... - :group => platform ? :sunos => :luke -} - -# i guess it has to be solved this way... - -platform ? :sunos => service["sleeper"] { - :group => :luke -} diff --git a/test/ts_parsing.rb b/test/ts_parsing.rb deleted file mode 100644 index b0a49e4a1..000000000 --- a/test/ts_parsing.rb +++ /dev/null @@ -1,5 +0,0 @@ -# $Id$ - -require "blinktest.rb" - -suite = TestSuite.new(%w{interpreter lexer parser}) |