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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Mon Mar 23 09:12:13 UTC 2015


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

The following commit has been merged in the master branch:
commit f98ee2508624b433cd29b51864ece04da95695a8
Author: Harald Sitter <sitter at kde.org>
Date:   Mon Mar 23 10:11:50 2015 +0100

    add changelog tests
---
 .../test_alphabase/debian/changelog                |  5 ++
 .../test_parse/debian/changelog                    | 11 ++++
 .../test_with_suffix/debian/changelog              |  5 ++
 .../test_with_suffix_and_epoch/debian/changelog    |  5 ++
 test/test_debian_changelog.rb                      | 71 ++++++++++++++++++++++
 5 files changed, 97 insertions(+)

diff --git a/test/data/test_debian_changelog/test_alphabase/debian/changelog b/test/data/test_debian_changelog/test_alphabase/debian/changelog
new file mode 100644
index 0000000..9df8134
--- /dev/null
+++ b/test/data/test_debian_changelog/test_alphabase/debian/changelog
@@ -0,0 +1,5 @@
+khelpcenter (4:5.2.1a-0ubuntu1) vivid; urgency=medium
+
+  * New upstream release
+
+ -- Scarlett Clark <sgclark at kubuntu.org>  Mon, 23 Feb 2015 09:38:32 -0800
diff --git a/test/data/test_debian_changelog/test_parse/debian/changelog b/test/data/test_debian_changelog/test_parse/debian/changelog
new file mode 100644
index 0000000..037db19
--- /dev/null
+++ b/test/data/test_debian_changelog/test_parse/debian/changelog
@@ -0,0 +1,11 @@
+khelpcenter (5.2.1-0ubuntu1) vivid; urgency=medium
+
+  * New upstream release
+
+ -- Scarlett Clark <sgclark at kubuntu.org>  Mon, 23 Feb 2015 09:38:32 -0800
+
+khelpcenter (5.2.0-0ubuntu1) vivid; urgency=medium
+
+  * New upstream release
+
+ -- Harald Sitter <sitter at kde.org>  Tue, 27 Jan 2015 14:51:48 +0100
diff --git a/test/data/test_debian_changelog/test_with_suffix/debian/changelog b/test/data/test_debian_changelog/test_with_suffix/debian/changelog
new file mode 100644
index 0000000..2218413
--- /dev/null
+++ b/test/data/test_debian_changelog/test_with_suffix/debian/changelog
@@ -0,0 +1,5 @@
+khelpcenter (5.2.1~git123-0ubuntu1) vivid; urgency=medium
+
+  * New upstream release
+
+ -- Scarlett Clark <sgclark at kubuntu.org>  Mon, 23 Feb 2015 09:38:32 -0800
diff --git a/test/data/test_debian_changelog/test_with_suffix_and_epoch/debian/changelog b/test/data/test_debian_changelog/test_with_suffix_and_epoch/debian/changelog
new file mode 100644
index 0000000..f14c6aa
--- /dev/null
+++ b/test/data/test_debian_changelog/test_with_suffix_and_epoch/debian/changelog
@@ -0,0 +1,5 @@
+khelpcenter (4:5.2.1~git123-0ubuntu1) vivid; urgency=medium
+
+  * New upstream release
+
+ -- Scarlett Clark <sgclark at kubuntu.org>  Mon, 23 Feb 2015 09:38:32 -0800
diff --git a/test/test_debian_changelog.rb b/test/test_debian_changelog.rb
new file mode 100644
index 0000000..415d39e
--- /dev/null
+++ b/test/test_debian_changelog.rb
@@ -0,0 +1,71 @@
+require 'test/unit'
+
+require_relative '../lib/debian/changelog'
+
+# Test debian/changelog
+class DebianChangelogTest < Test::Unit::TestCase
+  EPOCH      = 0b1
+  BASE       = 0b10
+  BASESUFFIX = 0b100
+  REVISION   = 0b1000
+  ALL        = 0b1111
+
+  def setup
+    script_base_path = File.expand_path(File.dirname(__FILE__))
+    script_name = File.basename(__FILE__, '.rb')
+    @datadir = File.join(script_base_path, 'data', script_name)
+    @previous_pwd = Dir.pwd
+    Dir.chdir(@datadir)
+  end
+
+  def teardown
+    Dir.chdir(@previous_pwd)
+  end
+
+  def data(path = nil)
+    index = 0
+    caller = ''
+    until caller.start_with?('test_')
+      caller = caller_locations(index, 1)[0].label
+      index += 1
+    end
+    File.join(*[@datadir, caller, path].compact)
+  end
+
+  def test_parse
+    c = Changelog.new(data)
+    assert_equal('khelpcenter', c.name)
+    assert_equal('', c.version(Changelog::EPOCH))
+    assert_equal('5.2.1', c.version(Changelog::BASE))
+    assert_equal('', c.version(Changelog::BASESUFFIX))
+    assert_equal('-0ubuntu1', c.version(Changelog::REVISION))
+    assert_equal('5.2.1-0ubuntu1', c.version(Changelog::ALL))
+  end
+
+  def test_with_suffix
+    c = Changelog.new(data)
+    assert_equal('', c.version(Changelog::EPOCH))
+    assert_equal('5.2.1', c.version(Changelog::BASE))
+    assert_equal('~git123', c.version(Changelog::BASESUFFIX))
+    assert_equal('-0ubuntu1', c.version(Changelog::REVISION))
+    assert_equal('5.2.1~git123-0ubuntu1', c.version(Changelog::ALL))
+  end
+
+  def test_with_suffix_and_epoch
+    c = Changelog.new(data)
+    assert_equal('4:', c.version(Changelog::EPOCH))
+    assert_equal('5.2.1', c.version(Changelog::BASE))
+    assert_equal('~git123', c.version(Changelog::BASESUFFIX))
+    assert_equal('-0ubuntu1', c.version(Changelog::REVISION))
+    assert_equal('4:5.2.1~git123-0ubuntu1', c.version(Changelog::ALL))
+  end
+
+  def test_alphabase
+    c = Changelog.new(data)
+    assert_equal('4:', c.version(Changelog::EPOCH))
+    assert_equal('5.2.1a', c.version(Changelog::BASE))
+    assert_equal('', c.version(Changelog::BASESUFFIX))
+    assert_equal('-0ubuntu1', c.version(Changelog::REVISION))
+    assert_equal('4:5.2.1a-0ubuntu1', c.version(Changelog::ALL))
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list