This commit is contained in:
2018-05-16 10:10:23 +02:00
commit 79abc63edd
597 changed files with 93351 additions and 0 deletions

37
node_modules/onoff/test/output-with-edge-bug.js generated vendored Normal file
View File

@ -0,0 +1,37 @@
"use strict";
// Test for https://github.com/fivdi/onoff/issues/87
//
// If a Gpio is instantiated for an output GPIO and the edge parameter is
// specified then the edge parameter should be ignored. Attempting to write
// the sysfs edge file for an output GPIO results in an
// "EIO: i/o error, write"
const Gpio = require('../onoff').Gpio;
const assert = require('assert');
function ensureGpio17Unexported(cb) {
let led = new Gpio(17, 'out');
led.unexport();
setTimeout(() => {
cb();
}, 100);
}
ensureGpio17Unexported(() => {
let led;
assert.doesNotThrow(
() => {
led = new Gpio(17, 'out', 'both');
},
'can\'t instantiate a Gpio for an output with edge option specified'
);
led.unexport();
console.log('ok - ' + __filename);
});