added adaptive quickshell
This commit is contained in:
1 parent
6eb56d2065
commit
5b33a73fd8
189 files changed
+8678
-15
No files matched your search
@@ -0,0 +1,17 @@
|
||||
const fs = require('fs');
|
||||
const vm = require('vm');
|
||||
const assert = require('node:assert/strict');
|
||||
const path = require('path');
|
||||
const source = fs.readFileSync(path.join(__dirname, '../services/Policy.js'), 'utf8')
|
||||
.replace(/^\.pragma.*$/gm, '').replace(/^\.import.*$/gm, '');
|
||||
const ctx = {WallpaperPolicy: {validate: () => {}}};
|
||||
vm.createContext(ctx);
|
||||
vm.runInContext(source, ctx);
|
||||
function plain(value) { return JSON.parse(JSON.stringify(value)); }
|
||||
assert.deepEqual(plain(ctx.homePages([], 12)), [[]]);
|
||||
assert.deepEqual(plain(ctx.homePages(['a','b','c'], 2)), [['a','b'],['c']]);
|
||||
assert.deepEqual(plain(ctx.moveFavorite(['a','b','c'], 'b', 1)), ['a','c','b']);
|
||||
assert.deepEqual(plain(ctx.moveFavorite(['a','b','c'], 'a', -1)), ['a','b','c']);
|
||||
assert.deepEqual(plain(ctx.moveFavorite(['a','b','c'], 'missing', 1)), ['a','b','c']);
|
||||
assert.throws(() => ctx.homePages(['a'], 0));
|
||||
console.log('PASS home pages and favorite reordering');
|
||||
Reference in new issue
Block a user