[SCM] ci-tooling packaging branch, master, updated. 4a37de3a5c7b2bf39425d4f0c53abdaedbf7445d

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Mar 17 09:17:45 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=68fedbd

The following commit has been merged in the master branch:
commit 68fedbd704960c98a4bc95b94c436f4e963a6fcb
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Mar 17 10:09:25 2015 +0100

    test the qml module class
---
 lib/qml.rb              | 20 ++------------------
 test/test_qml_module.rb | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/lib/qml.rb b/lib/qml.rb
index 6057bed..cc8e76a 100644
--- a/lib/qml.rb
+++ b/lib/qml.rb
@@ -1,20 +1,7 @@
-
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
-# FIXME: TEST
+require_relative 'dpkg'
 
 # Management construct for QML related bits.
 module QML
-  BUILTINS = %w(QtQuick)
   SEARCH_PATHS = ["/usr/lib/#{DPKG::HOST_MULTIARCH}/qt5/qml"]
 
   # Describes a QML module.
@@ -29,10 +16,6 @@ module QML
       new.send(:parse, line)
     end
 
-    def builtin?
-      BUILTINS.include?(identifier)
-    end
-
     def import_paths
       @import_paths if defined?(@import_paths)
       @import_paths = []
@@ -49,6 +32,7 @@ module QML
       "#{@identifier}[#{@version}]"
     end
 
+
     private
 
     def parse(line)
diff --git a/test/test_qml_module.rb b/test/test_qml_module.rb
new file mode 100644
index 0000000..b19c260
--- /dev/null
+++ b/test/test_qml_module.rb
@@ -0,0 +1,32 @@
+require 'test/unit'
+
+require_relative '../lib/qml'
+
+# Test qml module parsing
+class QMLDependencyVerifierTest < Test::Unit::TestCase
+  def test_empty_line
+    assert_nil(QML::Module.parse(''))
+  end
+
+  def test_short_line
+    assert_nil(QML::Module.parse('import QtQuick'))
+  end
+  # Too long line is in fact allowed for now
+
+  def test_no_import
+    assert_nil(QML::Module.parse('QtQuick import 1'))
+  end
+
+  def test_simple_parse
+    mod = QML::Module.parse('import QtQuick 1')
+    assert_equal('QtQuick', mod.identifier)
+    assert_equal('1', mod.version)
+    assert_equal("#{mod.identifier}[#{mod.version}]", mod.to_s)
+  end
+
+  def test_comment
+    assert_nil(QML::Module.parse('#import QtQuick 1'))
+    assert_nil(QML::Module.parse('#     import QtQuick 1'))
+    assert_nil(QML::Module.parse('    #   import QtQuick 1'))
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list