Skip to content

Commit

Permalink
chore: implement control testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tale committed Feb 15, 2022
1 parent 56ab75f commit efdcb34
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
40 changes: 40 additions & 0 deletions src/control.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { readFile } from 'node:fs/promises'
import { Control } from '.'

test('control:clang', async () => {
const data = await readFile('test/clang.control', 'utf8')
const control = new Control(data)


expect(control.package).toEqual('clang')
expect(control.source).toEqual('llvm-defaults (0.54)')
expect(control.version).toEqual('1:13.0-54')
expect(control.architecture).toEqual('amd64')
expect(control.installedSize).toEqual(24)
expect(control.section).toEqual('devel')
expect(control.priority).toEqual('optional')

expect(control.maintainer).toEqual('Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>')
expect(control.get('Original-Maintainer')).toEqual('LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>')

expect(control.depends).toEqual(expect.arrayContaining([
'clang-13 (>= 13~)'
]))

expect(control.breaks).toEqual(expect.arrayContaining([
'clang-3.2',
'clang-3.3',
'clang-3.4 (<< 1:3.4.2-7~exp1)',
'clang-3.5 (<< 1:3.5~+rc1-3~exp1)'
]))

expect(control.replaces).toEqual(expect.arrayContaining([
'clang (<< 3.2-1~exp2)',
'clang-3.2',
'clang-3.3',
'clang-3.4 (<< 1:3.4.2-7~exp1)',
'clang-3.5 (<< 1:3.5~+rc1-3~exp1)'
]))

expect(control.description).toEqual('C, C++ and Objective-C compiler (LLVM based), clang binary Clang project is a C, C++, Objective C and Objective C++ front-end for the LLVM compiler. Its goal is to offer a replacement to the GNU Compiler Collection (GCC). Clang implements all of the ISO C++ 1998, 11 and 14 standards and also provides most of the support of C++17. This is a dependency package providing the default clang compiler.')
})
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './control'
export * from './release'

/**
Expand Down
1 change: 0 additions & 1 deletion src/release.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { readFile } from 'node:fs/promises'
import { Release } from '.'


test('release:chariz', async () => {
const data = await readFile('test/chariz.release', 'utf8')
const release = new Release(data)
Expand Down
21 changes: 21 additions & 0 deletions test/clang.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Package: clang
Source: llvm-defaults (0.54)
Version: 1:13.0-54
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Installed-Size: 24
Depends: clang-13 (>= 13~)
Breaks: clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1)
Replaces: clang (<< 3.2-1~exp2), clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1)
Section: devel
Priority: optional
Description: C, C++ and Objective-C compiler (LLVM based), clang binary
Clang project is a C, C++, Objective C and Objective C++ front-end
for the LLVM compiler. Its goal is to offer a replacement to the GNU Compiler
Collection (GCC).
.
Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
provides most of the support of C++17.
.
This is a dependency package providing the default clang compiler.

0 comments on commit efdcb34

Please sign in to comment.